doutiaoku4495 2010-10-10 17:07
浏览 516

将多个命令插入预准备语句的错误

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!

  • 写回答

2条回答 默认 最新

  • dtt2012 2010-10-10 23:10
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害