That error message isn't from DBI, it's from SQL Server (Sybase) itself.
What data type is the ordercode column in the database? If it's an integer, the bind_param should do the trick.
What I suspect is that it's a varchar and DBI is guessing that it's a number (based on the parameter value that's being passed). If so, you can use bind_param(1, $ordercode, SQL_VARCHAR) to make sure the right type goes thru. (Your note implies bind_param "didn't work", but you don't mention what happened.)
If all else fails, you can call CONVERT (the Transact-SQL function, not DBI) in your SQL, something like this:
or other type. Again, you don't mention what type the column is, so I'm not sure if that code sample is 180 degrees out of phase. :-)$dbh->prepare(' SELECT customercode FROM customerorders WHERE ordercode = CONVERT(varchar, ?)');
In reply to Re: Win32 - DBD-ODBC - Sybase
by VSarkiss
in thread Win32 - DBD-ODBC - Sybase
by dmacdou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |