Subject Re: [firebird-python] fdb named parameters
Author Pavel Cisar
Hi,

FDB doesn't support named parameters for SQL queries. However, it's nice
idea so it's now in our tracker as feature request. I can't say when it
will be implemented, but I'll get to it eventually. As it's now accepted
feature request, any patch that implements it would be accepted if
technically possible.

http://tracker.firebirdsql.org/browse/PYFB-48

best regards
Pavel Cisar
IBPhoenix

Dne 24.2.2015 v 11:02 Ernesto Benestante ebenestante@...
[firebird-python] napsal(a):
> Hi, does FDB support named parameters in queries? Other python database
> adapters support specifying a name for the parameters in the SQL string
> and passing a dict to execute(), to bind the parameters to its values.
> Something like this:
>
>
> cur.execute('select * from customers where id = %(cid)d', {'cid': 3})
>
>
> That obviously does not work with FDB:
>
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line
> 3352, in execute
> self._ps = PreparedStatement(operation, self, True)
> File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line
> 1985, in __init__
> "Error while preparing SQL statement:")
> fdb.fbcore.DatabaseError: ('Error while preparing SQL statement:\n-
> SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = -104\n- Token
> unknown - line 1, column 37\n- %', -104, 335544569)
>
>
> Is there another way?
>
>
> Thanks...
>
>
> ------------------------------------
> Posted by: Ernesto Benestante <ebenestante@...>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
>