Also, set DBI trace and post the  results ( inline with your email not as an
attachment or it will get removed by the listserver)

DBI->trace( 2, "script_name.trace" );

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Tony Foiani
> Sent: Friday, February 02, 2001 6:23 PM
> To: Michael Officer
> Cc: [EMAIL PROTECTED]
> Subject: Re: Oracle & DBI
>
>
> >>>>> "Mike" == Michael Officer <[EMAIL PROTECTED]> writes:
>
> Mike> I've tried everything I can think of to get placeholders to work
> Mike> in a select statement through DBI.  We're using Oracle 8.1.5,
> Mike> DBD-Oracle 1.06, DBI 1.14, perl 5.004_04, all running under
> Mike> Solaris 2.8.  Placeholders (i.e. ?) work fine in inserts, just
> Mike> not selects. [...]
>
> Mike> Is this some sort of known bug with Oracle and DBI?  Thanks!
>
> This just worked for me:
>
> | #!/usr/bin/perl -w
> |
> | use strict;
> |
> | use DBI;
> | use DBD::Oracle;
> |
> | my $dbh = DBI->connect( 'dbi:Oracle:', 'xxx', 'xxx',
> |                         { AutoCommit => 0,
> |                           RaiseError => 1,
> |                           PrintError => 1 } );
> |
> | my $sql = 'SELECT * FROM code_master WHERE code_type = ?';
> | my $sth = $dbh->prepare($sql);
> |
> | $sth->execute('LOCATION_CD_TYPE');
> | while (my $cur = $sth->fetch())
> | {
> |     print join('|', @$cur), "\n";
> | }
> | $sth->finish();
> |
> | $dbh->disconnect();
> |
> | exit 0;
>
> So it's not a DBI nor DBD::Oracle issue, at least not on my platform.
> Sadly, my platform hasn't much in common with yours, so this doesn't
> narrow it down too much; but this sort of construct certainly does
> work.
>
> Platform info:
>
>    Perl 5.6.0
>    DBI 1.14
>    DBD::Oracle 1.06
>    Oracle 8.1.6.2
>    HP-UX 11.00
>
> I've also gotten this construct (SELECT + placeholders) to work with
> both Oracle and MySQL under Linux, so that's another reason to believe
> that DBI and DBD::Oracle are OK with this.  (Not to mention that it's
> such a common idiom that I would expect lots of things to break if
> they ever stopped being OK with this!)
>
> Maybe a more complete explaination of "does not work at all" would
> help us help you.  :) It also can't hurt to make sure that all
> possible warning systems are in place and turned on (e.g., "-w", "use
> strict", "RaiseError => 1" etc.).
>
> Good luck,
> t.
>

Reply via email to