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.