develooper Front page | perl.dbi.users | Postings from February 2001

Oracle & DBI

Thread Next
From:
Michael Officer
Date:
February 2, 2001 17:40
Subject:
Oracle & DBI
Message ID:
NIEBJGGGPGPNNLLJCHNOOECKCCAA.mofficer@vestek.com
I've tried everything I can think of to get placeholders to work in a select
statement through DBI.  We're using Oracle 8.1.5, DBD-Oracle 1.06, DBI 1.14,
perl 5.004_04, all running under Solaris 2.8.  Placeholders (i.e. ?) work
fine in inserts, just not selects.

For example,

$sth = $dbh->prepare ("INSERT INTO t_client (client_id, client_cd,
client_nm) VALUES (?, ?, ?)");
$sth->execute ($client_id, $client_cd, $client_nm);

will work fine.  However, saying

$sth = $dbh->prepare ("SELECT * FROM t_client WHERE client_id = ?");
$sth->execute ($client_id);

does not work at all.  The same SQL statement issued against the database
through a tool like SQL Plus yields a row.  And yes, $client_id has a
legitimate value in it.  I confirmed that in the debugger and through print
statements.

Is this some sort of known bug with Oracle and DBI?  Thanks!

Mike Officer
Senior Software Developer
Vestek Systems
388 Market Street, Ste. 700
San Francisco, CA  94111
(415) 283-2149 Direct
(415) 392-6831 Fax



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About