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

Shmuel Fomberg semuelf at 012.net.il
Thu Feb 8 08:42:02 PST 2007


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)

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);
		 


 
________________________________________________________________________
____________
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





More information about the Perl mailing list