I believe you may have to escape that '*' (\*) or use single quotes.  
If that doesn't work, try selecting specific column names.


-----Original Message-----
From: Michael Officer [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 8:30 PM
To: [EMAIL PROTECTED]
Subject: Oracle & DBI


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


Reply via email to