Home » SQL & PL/SQL » SQL & PL/SQL » inserting into records with primary key
inserting into records with primary key [message #8392] Fri, 15 August 2003 02:39 Go to next message
Stanley Beamish
Messages: 1
Registered: August 2003
Junior Member
I'm sure this is an often asked question, but I can't find an answer. If I have a table which includes a unique primary key, and I want to insert a new row, then how do I know what value to give the primary key without first doing a query to find out the current value. Is there an 'auto' mode as in MSAccess.

Cheers,
SB
Re: inserting into records with primary key [message #8395 is a reply to message #8392] Fri, 15 August 2003 08:00 Go to previous message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
quote from Stanley Beamish:
----------------------------------------------------------------------
I'm sure this is an often asked question, but I can't find an answer. If I have a table which includes a unique primary key, and I want to insert a new row, then how do I know what value to give the primary key without first doing a query to find out the current value. Is there an 'auto' mode as in MSAccess.

Cheers,
SB

----------------------------------------------------------------------
Stanley,

In Oracle, the customary method employed to meet your requirement is a sequence.

HTH,

A.
Previous Topic: Reg:SQL Query.........
Next Topic: Accessing from multiple partitions
Goto Forum:
  


Current Time: Fri Apr 26 14:24:34 CDT 2024