Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> how to achieve autoincremented PKs (as datatype SERIAL does)
Hallo folks,
is it possible to put the handling of autogenerating PK to Oracle? I think to remember from Informix the datatype SERIAL that makes it quite easy as I don't have to determine a new value for the key. I just would like to insert a row without having to know or (calculate) the value of the new record. For a short time I thought of:
but this cannot be a serious solution since it would run into trouble
with concurrent inserts.
Could anyone give me a hint how to implement something I only have to
do something like
INSERT INTO customer VALUES ('Sven','Grundmann');
Finally, to top all this I want to execute this statment from within Java Code via JDBC. Is there any supported way to precalc the pk?
TIA
Frank
frank_ratzlow_at_nojunk.hotmail.com
Received on Thu Feb 27 2003 - 05:57:00 CST