This is sort of a rehash of
DBD::CSV :1 Syntax Placeholder with some updated info.
When I use only one placeholder using a SELECT statement I can get placeholders to work. As soon as I try to use two placeholders my statements come back with out finding any data in my database.
For example this will work using only one placeholder:
my $sth_IP = $dbh->prepare("SELECT IPADDRESS FROM AP WHERE ID=? ")
or die "Can't prepare SQL statement: $DBI::errstr\n";
$sth_AP_IP->execute($BACKUPID)
or die "Can't execute SQL statement: $DBI::errstr\n";
But when I try to use two placeholders my fetchrow_array comes back without any data. Here's my code using two placeholders:
my $sth_Service_Node = $dbh->prepare("SELECT SNID, FRAMEID FROM ORG WH
+ERE SITE=? AND ID=? AND OFFSET=?")
or die "Can't prepare SQL statement: $DBI::errstr\n";
$sth_Service_Node->execute($SITEID, $ID, $OFF)
or die "Can't execute SQL statement: $DBI::errstr\n";
Is there anything different I should be doing to get two (2) placeholders to work?I know my query is correct for multiple placeholders because when I put the scalars directly into the query and remove the placeholders the query comes back okay.
I'm using DBD::CSV ver 0.22 and SQL::Statement ver 1.14
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.