Prepared statements

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
stonefull
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 02.06.2010, 03:02

Prepared statements

Post by stonefull »

Anyone know how to use prepared statements in zeos?

Thanks

Carlos
User avatar
Pitfiend
Senior Boarder
Senior Boarder
Posts: 68
Joined: 12.12.2009, 07:27

Post 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.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Post Reply