Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Strange PB !?
Hi, all
I've in many of my PL/SQL procedures to create a new record in a table just with Key code = Last key + 1, (key_code is the table primary key)
to do this i've written the following PL/SQL code :
htp.print(last_key_code);
insert into myTable values (last_key_code+1,...);
When myTable is empty this algorithm never works, when attemping to print value to 'last_key_code' in such situation (myTable is empty) nothing is printed, and 'insert into' procedure return error !!! i add an 'if' statment to make it work but doesn't solve the pb :
I think that we can automate such operations by creating a 'sequence' ? how ?
Anyone can help please?
Thanks.
Wassim,
e-mail: net2000_at_francemel.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Sat Jun 12 1999 - 20:12:33 CDT
![]() |
![]() |