[freetds] Question about FreeTDS, DBD::ODBC and bind parameters with prepar ed statements

Frediano Ziglio freddy77 at gmail.com
Tue May 5 10:32:40 EDT 2009


2009/5/5 James K. Lowden <jklowden at freetds.org>
>
> Will.Saxon at sage.com wrote:
> > If I try to prepare a statement containing placeholders for fields with
> > a binary datatype, I get the following error:
> >
> > DBD::ODBC::db prepare failed: [unixODBC][FreeTDS][SQL
> > Server]Statement(s) could not be prepared. (SQL-42000)
> > [unixODBC][FreeTDS][SQL Server]Implicit conversion from data type
> > varchar to binary is not allowed. Use the CONVERT function to run this
> > query. (SQL-22018)(DBD: st_prepare/SQLPrepare err=-1)
> >
> > The documentation for DBD::ODBC suggests that this can happen if the
> > driver does not support SQLDescribeParam. In these cases a default
> > parameter type of SQL_VARCHAR is used.
>
> $ grep SQLDescribeParam doc/api_status.txt
> odbc    (all)   SQLDescribeParam        unimplemented

Yes, currently not implemented... it require sql parsing. Note however
that I used many time DBD::ODBC specifying parameters type before to
override default. Just use third bind_param argument

freddy77



More information about the FreeTDS mailing list