[Israel.pm] bind values are not working with oracle?

Adriano Ferreira a.r.ferreira at gmail.com
Thu Feb 8 08:50:12 PST 2007


On 2/8/07, Shmuel Fomberg <semuelf at 012.net.il> wrote:
> Hello There.
>
> I don't see in DBI syntax a selectrow_array with three parameter.
> (http://search.cpan.org/~timb/DBI-1.53/DBI.pm)

It is not in the SYNOPSIS, but at the section which documents the
function (with more details):

http://search.cpan.org/~timb/DBI-1.53/DBI.pm#selectrow_array

>
> Maybe what you really want to do is:
> $sth = $dbh->prepare(SELECT xy FROM tableName WHERE x =? AND y = ?;");
> $sth->execute($x, $y);
> while ( @row = $sth->fetchrow_array ) {
>     print "@row\n";
> }
>
> Shmuel.
>
> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
> Behalf Of rami doqa
> Sent: Thursday, February 08, 2007 9:29 AM
> To: perl at perl.org.il
> Subject: [Israel.pm] bind values are not working with oracle?
>
> Hi everybody. Can any one help me please why binding
> values are not working with oracle?
>
> My example:
>
> my $x = 100;
> my $y ='blabla';
>
> # this is not working:
> my $sql = "SELECT xy FROM tableName WHERE x =? AND y
> =?";
>
> $self->{dbh}->selectrow_array( $sql, undef, ($x,$y) );
>
>
> # tnis code is working fine:
> my $sql = "SELECT xy FROM tableName WHERE x =$x AND y
> ='$y'";
>
> $self->{dbh}->selectrow_array($sql);

Test the return to see if it failed or not (returns undef in failure)
or make sure RaiseError is set at the connection creation.
$DBI::errstr may contain an error message that helps to track the
problem.

>
>
>
>
> ________________________________________________________________________
> ____________
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.17.31/676 - Release Date:
> 08/02/2007 15:04
>
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



More information about the Perl mailing list