http://www.perlmonks.org?node_id=1103262


in reply to Re^4: SQL query using elements from array
in thread SQL query using elements from array

You can safely use a lot more parameteres than you are using. That error string does not look complete. It should contain an ODBC status code and a set of strings in square brackets showing what is reporting the error. Can we see the full string.

  • Comment on Re^5: SQL query using elements from array

Replies are listed 'Best First'.
Re^6: SQL query using elements from array
by AllPaoTeam (Acolyte) on Oct 13, 2014 at 03:25 UTC
    Yes, I would really appreciate it someone could help me solve this issue, below is the full error:
    DBD::ODBC::st execute faile: [Microsoft}[ODBC SQL Server Driver][SQL S +erver Conversion failed when converting data and/or time from charact +er string. (SQL-22007) at test10.pl line 40. DBD::ODBC::st fetchrow_a +rray failed: no select statement currently executing (SQL-HY000) at t +est10.pl line 42.
    It repeats that twice. Thanks again!!!

      Can you show us the schema for the table you are selecting from and the contens of $h->{ParamValues} after the execute (where $h is your statement handle). You might want to "use Data::Dumper" and "print Dumper($h->{ParamValues})". If you have RaiseError set you'll have to wrap the fetchrow_array in an eval or disable RaiseError to capture the ParamValues.

        Can you write me an example, I am not sure how to do that. Thanks again for taking the time to help me. -Pao