createing a table Using Alphanumeric sequence

Newbie Member
8Jan2013,12:45   #1
askr's Avatar
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
Mentor
9Jan2013,13:57   #2
xpi0t0s's Avatar
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 like this
Newbie Member
10Jan2013,18:59   #3
askr's Avatar
Quote:
Originally Posted by xpi0t0s View Post
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
Mentor
11Jan2013,20:50   #4
xpi0t0s's Avatar
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 like this
Newbie Member
12Jan2013,05:56   #5
askr's Avatar
Quote:
Originally Posted by xpi0t0s View Post
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.