Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Strange problem with DBI placeholders

by skx (Parson)
on Sep 12, 2006 at 20:18 UTC ( [id://572614]=note: print w/replies, xml ) Need Help??


in reply to Strange problem with DBI placeholders

Have you tryed coercing the type correctly?

I know that I've done this in the past, since I have code samples in front of me where it is present but honestly I can't remember why I believed it was necessary right now!

Here is my suggestion:

use DBI qw/ :sql_types / ; # Database interface my $h_sql1 = $db_inv->prepare_cached( "select items from item_a where item_code = ? and item_stock = ?" ) or die $DBI::errstr; $h_sql1->bind_param( 1, "A0001" ); $h_sql1->bind_param( 2, 8, SQL_INTEGER ); $h_sql1->execute();
Steve
--

Replies are listed 'Best First'.
Re^2: Strange problem with DBI placeholders
by Anonymous Monk on Sep 13, 2006 at 14:54 UTC
    Thanks for all your replies.

    Unfortunately, I've tried everything you people suggested and nothing worked.So, I've kind of given up on it for now.

    What I'm doing now is to retrieve all combinations of item code and item stock, and store these in a hash table. This way I can query the hash table later on.

    Not the best way to do I know, but I've spent a few days on this issue and need to move on.

    Thanks for all your inputs anyway.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found