awohld has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: DBD::CSV SQL::Statement Placeholder Usage
by jZed (Prior) on Sep 27, 2005 at 17:55 UTC
    As I said in a message to you, this is a bad bug. I think I have fixed it, please try it at the SVN repository and let me know if it fixes the problem.
      Sorry, didn't see the message. I'll try it right now. Thanks!
        No problem, if you want to be thanked for finding the bug in the Changes log, please /msg me your name/email. (bug-reporting)++
      I was having this exact problem yesterday. I downloaded and tried out your fix, and it works. thanks!