Create a sequence, like so
CREATE SEQUENCE "WHATEVER_IDS" 
        INCREMENT BY 1 
        START WITH 1 
        MAXVALUE 1.0E28 
        MINVALUE 1 
        NOCYCLE 
        CACHE 20 
        NOORDER;

then when you insert
INSERT INTO test (whatever_ids.nextval);

the nice thing is that in your next query you can just do
whatever_ids.curval 
instead of looking up the value with mysql_auto_id or whatever the function
is. 

-----Original Message-----
From: Duy B [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 7:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Oracle question


Dear all,
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,
ten char(10));

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,
BaoDuy




-- 
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]

Reply via email to