Prepared statements

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

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

Prepared statements

Postby stonefull » 27.09.2010, 01:22

Anyone know how to use prepared statements in zeos?

Thanks

Carlos

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

Postby Pitfiend » 28.09.2010, 05:21

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:

Postby mdaems » 13.10.2010, 22:50

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


Return to “PostgreSQL”

Who is online

Users browsing this forum: No registered users and 1 guest