Page 1 of 1

Prepared statements

Posted: 27.09.2010, 01:22
by stonefull
Anyone know how to use prepared statements in zeos?

Thanks

Carlos

Posted: 28.09.2010, 05:21
by Pitfiend
As long as I'm aware, there's no such thing under Zeos hood v6 stable.

You have 2 ways to execute sql statements:
a) Fill the sql property of a zquery and call execsql.
b) Call executedirect from a zconnection.

Posted: 13.10.2010, 22:50
by mdaems
Pitfiend,

Your answer is correct. Not available in 6.6 nor 7.0.

7.0 simulates prepared statements, however. At least for Postgres. For Firebird they really work.

As far as I understand postgres docs, in libpq 'PQexecPrepared is supported only in protocol 3.0 and later connections; it will fail when using protocol 2.0'.

So who volunteers to code the stuff for postgres prepared statements in zeoslib 7.X? Sample implementations of prepared statements are available already for mysql and firebird. (This implementation should be version dependent, so older pg versions just work using emulation)

Mark