createing a table Using Alphanumeric sequence

askr's Avatar, Join Date: Dec 2012
Newbie Member
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
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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
0
askr's Avatar, Join Date: Dec 2012
Newbie Member
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
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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
0
askr's Avatar, Join Date: Dec 2012
Newbie Member
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.