mainada has asked for the wisdom of the Perl Monks concerning the following question:
Funny enough (or perhaps not), this code works fine if I use one sole constrain / placeholder in the SQL statement.$sql ="select serial_number, item_id from serial_item_inv where serial +_number=? and item_id=?"; $dbh = DBI->connect ($dbname, $user, $password, 'Oracle'); $sth = $dbh->prepare($sql); print "Enter a Serial Number and an Item ID: "; while (<>) { chomp; ($sn, $ii) = split /\s/; $sth->execute($sn, $ii); ($s, $i) = $sth->fetchrow_array(); print "Serial Number: $s Item ID: $i\n"; }; $sth->finish(); $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't fetch using 2 placeholders in SELECT statement
by mpeppler (Vicar) on Jan 18, 2002 at 22:40 UTC | |
|
Re: Can't fetch using 2 placeholders in SELECT statement
by chromatic (Archbishop) on Jan 19, 2002 at 02:06 UTC | |
|
Re: Can't fetch using 2 placeholders in SELECT statement
by trs80 (Priest) on Jan 18, 2002 at 23:35 UTC |