I've run into an instance where executing a prepared statement when
BoolsAsChars=1 is set returns the error:
ERROR: ODBC: State S1000: Could not convert binary other than LO type
The setup is having a table containing two columns:
* one column has a bytea domain
* another column is of type VARCHAR of exactly 5 characters
CREATE DOMAIN my_bytea_domain AS bytea;
CREATE TABLE my_table
(
my_binary_column my_bytea_domain,
my_varchar_column varchar(5)
);
The error triggers when executing a prepared statement of the form:
SELECT * FROM my_table WHERE 'my_varchar_column' = ? AND
'my_binary_column' = ?
Under the above conditions, HowToPrepareBeforeExec() returns
shouldParse. This causes prepareParameters() to call
SendSyncAndReceive() which in turn calls PIC_set_pgtype() setting
.PGType to my_bytea_domain for the binary parameter. Eventually when
ResolveOneParam() calls PIC_dsp_pgtype() on the binary parameter,
.PGType is already set to a non-NULL value, so is not set to PG_TYPE_BYTEA.
Thanks
Keri
--
_____________________________________________
Keri Harris
Software Engineer
SecuritEase
Tel: +64 4 917-6670
Fax: +64 4 917-6671
E-mail: keri.harris@securitease.com
Visit us at: http://www.securitease.com
_____________________________________________
This e-mail passed our content security scan.
It is covered by the confidentiality clauses at
http://www.securitease.com/content_and_confidentiality