views:

40

answers:

1

I'm using Pdo_Mssql adapter against a Sybase database and working around issues encountered. One pesky issue remaining is Zend_Db's instance on quoting BIT field values. When running the following for an insert:

$row = $this->createRow(); ... $row->MyBitField = $data['MyBitField']; ... $row->save();

FreeTDS log output shows:

dbutil.c:87:msgno 257: "Implicit conversion from datatype 'VARCHAR' to 'BIT' is not allowed. Use the CONVERT function to run this query.

I've tried casting values as int and bool, but this seems to be a table metadata problem, not a data type problem with input.

Fortunately, Zend_Db_Expr works nicely. The following works, but I'd like to be database server agnostic.

$row->MyBitField = new Zend_Db_Expr("CONVERT(BIT, {$data['MyBitField']})");

I've verified that the describeTable() is returning BIT for the field. Any ideas on how to get ZF to stop quoting MS SQL/Sybase BIT fields?

A: 

Hello, i've to do a application with sybase ase 15.03 and zend framework 1.10 but i can't connect with the database without php_pdo_odbc (it doesn't work with pdo_mssql :().

Which version of sybase ase do you have ? I am very interested to know how do you do your connection. Can i have an example please ?

Thanks

ronny
I'm working against Sybase ASE 15. You should post your question separately with full details of your PHP environment. I'll be happy to try and help you in a separate thread.
Chad Kieffer