Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: SQL and Placeholders

by pfaut (Priest)
on Mar 15, 2003 at 23:09 UTC ( [id://243364]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://243364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (None)
    As of 2024-04-25 00:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found