Create a sequence, like so
CREATE SEQUENCE "WHATEVER_IDS"
INCREMENT BY 1
START WITH 1
then when you insert
INSERT INTO test (whatever_ids.nextval);
the nice thing is that in your next query you can just do
instead of looking up the value with mysql_auto_id or whatever the function
From: Duy B [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 7:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Oracle question
If i want to use id field in Oracle database, how can i do?
For example, in MySQL
create table test (
id int not null auto-increment primary key,
So that, when i insert a new row into MySQL database, id increases by 1.
But in Oracle i couldn't use as that.
Somebody could help me.
Thanks you all,
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]