Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Oracle (http://www.go4expert.com/forums/oracle-forum/)
-   -   createing a table Using Alphanumeric sequence (http://www.go4expert.com/forums/createing-table-using-alphanumeric-t29408/)

askr 8Jan2013 12:45

createing a table Using Alphanumeric sequence
 
Hello friends,

I want to Create a Table with a Alpha Numeric Sequence,

Is there any way to create sequence without using Triggers. If so please Help me..


Thanks in Advance...


regards

askr

xpi0t0s 9Jan2013 13:57

Re: createing a table Using Alphanumeric sequence
 
If you only have one process that writes to the table then you could do something like SELECT MAX() on a numeric column, add 1, then make that the identifier. That won't work with an alphanumeric sequence though. But if you have some way to determine the next valid sequence value then you can perform that operation before each insert.

What are you trying to do?
Why does the sequence need to be alphanumeric (as opposed to just numeric)?

askr 10Jan2013 18:59

Re: createing a table Using Alphanumeric sequence
 
Quote:

Originally Posted by xpi0t0s (Post 98681)
If you only have one process that writes to the table then you could do something like SELECT MAX() on a numeric column, add 1, then make that the identifier. That won't work with an alphanumeric sequence though. But if you have some way to determine the next valid sequence value then you can perform that operation before each insert.

What are you trying to do?
Why does the sequence need to be alphanumeric (as opposed to just numeric)?

Sir, We are creating a database for training institute, so for every table we want to use unique Number with Alpha Numeric...as it is going to be easy for identifying.

Example for Students Table : Std1
Example for Batches Table : B105

xpi0t0s 11Jan2013 20:50

Re: createing a table Using Alphanumeric sequence
 
Why isn't a simple number enough? For example, SELECT ... WHERE BATCHES.ID=105; is clear enough. You shouldn't need to include an abbreviation of the table name within the table ID field.

askr 12Jan2013 05:56

Re: createing a table Using Alphanumeric sequence
 
Quote:

Originally Posted by xpi0t0s (Post 98722)
Why isn't a simple number enough? For example, SELECT ... WHERE BATCHES.ID=105; is clear enough. You shouldn't need to include an abbreviation of the table name within the table ID field.

Ok..... Thanks allot Mate.


All times are GMT +5.5. The time now is 16:04.