Click to See Complete Forum and Search --> : Oracle insert


Anon
10-21-2000, 04:12 PM
Please let me know if someone knows how to insert a auto incrementing field to an oracle DB using PHP.

Anon
10-23-2000, 10:00 AM
This is how is done using Oracle. I'm not sure in PHP.

You need to define a "sequence" first.

create sequence SEQ_NAME
increment by 1
start with 1
nomaxvalue
nocycle;

when insert you need something like this.

insert into TABLE_NAME ( id, name, sex)
values ( SEQ_NAME.nextval, 'HELLO', 'M');

Good luck,
Andrew

Anon
10-24-2000, 04:10 PM
I _JUST_ read an article on this on weberdev.com. It's listed underneath PHP and is titled simply "autoincrement", do a search on that and it pulls it up. It was pretty explanatory about the goofy nature of Oracle and not having a simple means to autoincrement.

Hope this helps,

Zack