Here is the code I used for the connection to the database :
my $dbh= DBI->connect("dbi:Oracle:host=<host name>;sid=<sid>", $user,
$password);
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
And the code of the select statement :
my $query= "select type from productTypes";
my $sth= $dbh->prepare($query);
$sth->execute();
my $rawRef;
while(($rawRef= $sth->fetchrow_arrayref())) {
� push(@choices, $rawRef->[0]);
}
and the first call to the fetchrow_arrayref function returned "undef", so
we never entered in the while loop.
I also tried the following :
my $query= "select type from productTypes";
$choices = $dbh->selectcol_arrayref($query);
and the returned reference ($choices) points to an empty array.
For information : the Oracle server is Oracle 8i
The release of DBI module is : DBI-1.14
The release of DBD::Oracle driver module is : DBD-Oracle-1.09
Robert Jones told me to try "fetchrow_array" instead of "fetchrow_arrayref"
, but the result is the same.
Thank you all for your help
"Sterin, Ilya" wrote: Yes, I think everyone on this list has experience:-)
You need to give us a sample code as well as a little more info, before we
can help, since as of right now, no one knows what you are doing wrong.
Ilya
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 9/20/01 6:39 AM
Subject: DBI use with DBD:Oracle module
Hi.
I'm trying to use DBI with the DBD::Oracle driver.
The connection seems to work, but even a simple query like "select
col_name from table" doesn't return any record in the fetch.
Does anyone have experienced the use of DBI with Oracle ???
Thanks a lot
Tewfik, a simple developper.
(See attached file: lokmane.vcf)
�<<lokmane.vcf>>
=?iso-8859-1?Q?lokmane.vcf?=