Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> OT: perl DBI/DBD: can I pass in an array as parameter?

OT: perl DBI/DBD: can I pass in an array as parameter?

From: Guang Mei <gmei_at_incyte.com>
Date: Tue, 01 Jul 2003 09:02:04 -0700
Message-ID: <F001.005BCE13.20030701081949@fatcity.com>


Hi:

Does anyone know if I can pass an array in perl to an sql using DBI/DBD so that I get result set from Oracle?

Specifically, I want do something like in perl:

$sth = $dbh->prepare (" select tab1.col1, tab2.col2 from tab1, tab2

       where tab1.ID1 = tab2.ID2
       and   tab1.X = ? ");

my @my_array;

# filling in my_array with data here

$sth->execute(@my_array);

my ($col1, $col2);
while(($col1, $col2) = $sth->fetchrow_array()) {

  # do processing of $col1 and $col2;
}

I am hoping to save repeated sql calls, do only one call and get all the rows back.

Is it possible in any version DBI/DBD? I looked at

http://perldoc.com/perl5.6.1/lib/DBI.html

and I does not seem to be able to figure it out. If it is possible, any simple example code somewhere?

Thanks.

Guang

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Guang Mei
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Jul 01 2003 - 11:02:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US