tags:

views:

42

answers:

1

Hello,

I'm working with Zend and postgres database, and I want get a result from a sql query that has inside more than one command. What I exactly want is create a table with some data and then ask for these data in a select query all in the same statement.

but when it is executed, I got this bug:

ERROR: cannot insert multiple commands into a prepared statement

I have found a way to solve it inserting "/" before the second command, but it did not work.

thanks in advance for help or advices about that!

A: 

That would be more helpful if you pasted your code here as well.

I'm not sure if what you're referring to is actually a sql query. What you seem to be doing is to append a few SQL commands such as a create, an insert and a select into one prepared statement! Instead, you either need to send these commands separately or create separate prepared statements. As far as I know postgres forbids multiple SQL commands in a single prepare call.

Pirooz