For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2007 > Perl DBI Oracle: bind an array list









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Perl DBI Oracle: bind an array list
Nitin Aggarwal

2007-02-16, 3:59 am

Hi,

I am using bind variables for executing a select query which uses "in"
operator. Following is the prototype of my code:

$query = "select a from tab where b in (:1)";
@list = {"A","B","C","D"};
$list_values = join("','",@list);
$DBI-> connect (..);
$sth -> prepare($query);
$sth-> execute ($list_values);
$array_ref = $sth->fetchrow_arrayref

This does not return me any values.
I suspect the issue is with the usage of passing up the comma separated
values as the parameter to the execute function.


Thanks,
Nitin

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com