On Tue, Aug 31, 2004 at 01:19:52PM +0200, Jean-Pierre Utter Löfgren wrote: > Does anybody have a clue on how to bind oracle sequences.
I don't think you have to. > ....is however that I use sequences in the database inserts for various > reasons, as some inserts use the same primary key, sub-data needs to be > referenced to each other etc. Using DBI/DBD, it handles inserts using > sequneces very nicely as long as I do > > $sth->prepare ( "insert into foo (my_id, data) values > (my_id_seq.nextval, 'bar')" ); > $sth->execute(); I think you would want to do this: $sth->prepare("insert into foo (my_id, data) values (my_id_seq.nextval, ?)"); $sth->execute('bar'); I could be wrong, but putting the sequence in a bind variable does not help speed/efficiency. Since it is not variable (it is always, my_id_seq.nextval), the SQL does not change so the SQL need only be prepared once and can be executed many times, getting the .nextval every time. Also, the SQL does not change so Oracle can keep it in its cache. So I think the answer to your question is, you don't have to worry about it. dd -- David Dooling