Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Auto incrementing key

Re: Auto incrementing key

From: <chanakam2000_at_gmail.com>
Date: 9 Apr 2006 22:53:33 -0700
Message-ID: <1144648413.712902.171730@z34g2000cwc.googlegroups.com>


|BTW: It is very very bad form to ever create a key of the type
'S-00001'
|you demonstrate above. Don't do it. If you need the "S" put it into a
|separate column and leave out the hyphen

I want to generate 'S-00001' (this was example) type key because to identify student from several department

Ex: For engineering student en-00001,....

      For Agriculture student ag-00001,.... etc

I have to have keys for book codes also

Ex: For computer subjects book co-00001,....

keeping seperate column for s and 00001 idea is Ok. (I will have to use two columns as primary key);
But even I don't know how to get 00001,00002 from sequence i can get 1,2,3 (not 5 digit format) [I used trigger for inserting]

I'm Sorry for my bad english. I hope you can understand my question.

Please help me. Received on Mon Apr 10 2006 - 00:53:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US