Subject Re: [firebird-python] fdb 1.4.3, SA 0.9.7 on Py2.7 conversion error
Author Pavel Cisar
Hi Werner,

Dne 4.2.2015 v 17:11 Werner wernerfbd@... [firebird-python] napsal(a):
>
> result = session.connection().execute(s, fk_authuser_id_1=1,
> maturityfirst_1='', maturityfirst_2='')
>
> for i in result:
> print(i)
>
> The two "maturityfirst" are integer columns and I inadvertently used a
> string for the filter value.
>
> It would be nice if fdb could get a more detailed error to make it
> easier to track down such an error.

I see. The problem is that FDB supports automatic conversion from string
values like KInterbasDB did, because it's feature of Firebird. It's also
documented, see
http://pythonhosted.org//fdb/usage-guide.html#implicit-conversion-of-input-parameters-from-strings

So if you wouldn't use empty strings but numeric strings like '12565' it
would work just fine. The conversion is done by Firebird, not by FDB
(driver just changes XSQLVAR.sqltype to SQL_TEXT and passes the string
parameter value to client library, so it's not checked for validity in
any way (you know, it could be a date, timestamp, decimal or float etc.
not just integer). if there is any problem, it's detected an reported by
Firebird client (in this case it's SQLCODE: -303) so FDB couldn't help
you here with more detailed error message.

best regards
Pavel Cisar
IBPhoenix