Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Tim Bunce
On Tue, Aug 31, 2004 at 07:54:40AM -0400, Hardy Merrill wrote: > I'm no Oracle expert, but I've always done it the way you originally did it: > > $sth->prepare ( "insert into foo (my_id, data) values > (my_id_seq.nextval, 'bar')" ); > $sth->execute(); > > I searched for "seq" in '

RE: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Reidy, Ron
This solution requires an extra network hop. The better solution is a before insert trigger to populate the column. - Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Ravi Kongara [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 31, 2004 4:55 PM To: Jean

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Ravi Kongara
Alternative solution could be like this, but it's based on assumption that the sequence is exclusively used by current application/transaction... At the start of program fetch my_id_seq.nextval to a variable and build a sequence array starting with that nextval. my $start_num = $dbh->selectrow_ar

Re: Fix for DBD::mysql column_info() method for MySQL 4.1

2004-08-31 Thread Tim Bunce
On Mon, Aug 30, 2004 at 11:47:57PM +0100, Tim Bunce wrote: > On Mon, Aug 30, 2004 at 04:44:30PM +0100, Tim Bunce wrote: > > The attached patch fixes DBD::mysql column_info() method for MySQL 4.1 > > and makes some other general improvements. > > > > The change was needed because while MySQL <= 4.0

Re: Core in connecting to Oracle using DBD

2004-08-31 Thread xaver biton
Sean Owens wrote: Version of Perl 5.005_03 Version of AIX is 4.2! Version of Oracle is 8.1.5 DBD-Oracle-1.03 DBI-1.13 The problem is that the script below bombs out only the 2nd and subsequent times I run it. What I have tried I have tried recompiling the DBD and the DBI using xlr_c instead of cc t

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Ian Harisay
try $data = 'bar';$sth->prepare (insert into foo (my_id, data) values(my_id_seq.nextval,?));$sth->execute($data);What you are doing below is passing the string value my_id_seq.nextval to the field my_id. >>>Jean-Pierre Utter Lfgren <[EMAIL PROTECTED]> 08/30 10:19 pm >>> Does anybo

RE: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Helck, Timothy
Sorry, I meant to reply to the list. In most cases a trigger probably is the best. -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 31, 2004 10:54 AM To: Helck, Timothy Subject: RE: How to use sequences in DBI/DBD::Oracle with bind A trigger is better.

RE: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Reidy, Ron
Use a before insert trigger to populate the column. - Ron Reidy Senior DBA Array BioPharma, Inc. -Original Message- From: Jean-Pierre Utter Löfgren [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 31, 2004 5:20 AM To: [EMAIL PROTECTED] Subject: How to use sequences in DBI/

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread David
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

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread =?ISO-8859-1?Q?Jean-Pierre_Utter_L=F6fgren?=
Thanks for your response, Hardy! I read that too, but since I dynamicaly build the "meta-sql" code in another application, I haven't really control over knowing where the sequence are located and wether the occcur in a statment or not. Kind of tricky this one. Thanks also Andy and Jon for your m

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Peter J. Holzer
On 2004-08-31 13:19:52 +0200, Jean-Pierre Utter Löfgren wrote: > 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(); > > But if I rearange the code to be more

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Hardy Merrill
I'm no Oracle expert, but I've always done it the way you originally did it: $sth->prepare ( "insert into foo (my_id, data) values (my_id_seq.nextval, 'bar')" ); $sth->execute(); I searched for "seq" in 'perldoc DBD::Oracle' and found this under LOB locator stuff:

How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread =?ISO-8859-1?Q?Jean-Pierre_Utter_L=F6fgren?=
Does anybody have a clue on how to bind oracle sequences. Background: Due to the large amount of data to be loaded into our oracle9i db by our applications, a bulk-load software would have been our first choice to handle the inserts. However, since our data is higly dynamic in its construction, thi