http://qs321.pair.com?node_id=243364


in reply to SQL and Placeholders

Since the value is all numeric, DBI/DBD might be attempting to treat it as a number instead of a string. This could be a problem since it's too large for an int unless you have a 64-bit perl. You might try explicitly binding as a string.

use DBI qw(:sql_types); my $query="SELECT * FROM $table WHERE (ukey = ?)"; my $sth=$dbh->prepare($query); $sth->bind_param(1, $ukey, SQL_VARCHAR); $sth->execute();

BTW, since you're not checking the returns, I hope you have RaiseError set.

--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Replies are listed 'Best First'.
Re: Re: SQL and Placeholders
by digger (Friar) on Mar 16, 2003 at 02:16 UTC
    I am setting RaiseError to 1 when I create the connection. When I first created this code, I was checking after every action. Thank $deity for the documentation. I am going to save many keystrokes with RaiseError.

    Thanks,
    digger