Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Number formatting question
Ashish schreef:
> Hi,
>
> Sorry for asking such a dumb question.
> I have an alphanumeric key, the last 2 digits of which should increment
> every time a new record is saved. For this, I extract the last 2 digits
> from the key (using substr) and increment it (add 1 to it). But when i
> do a to_char() of this new number, it introduces a blank space.
>
> For example: My key is in this format : TR05SEP200601. Here TR is item
> code(say), 05SEP2006 is the system date and 01 is the serial number. If
> i save another item of type TR on 05-SEP-2006, the number should be
> TR05SEP200602.
Extremely bad idea - your model sucks!
What when you had 99 new records?
Ever heard of modeling? Normalization?
Relational Databases?
What is wrong with a 3 column key?
ITEM_CODE varchar2(2) DATE_OF_MANUF date SERIAL_NUMBER number
-- Regards, Frank van Bortel Top-posting is one way to shut me up...Received on Wed Sep 06 2006 - 07:08:22 CDT
![]() |
![]() |