PostgreSql中如何执行字符串命令,类似MS SQL的exec(commandstring) ? 谢谢!

ccnh 2006-11-09 09:52:51

在MS SQL中可以执行 exec ('select * from stServerList')

在PostgreSQL中执行下面的语句时:
execute 'select * from stServerList'

提示:
ERROR: syntax error at or near "'select * from stServerList' " at character 9

应如何解决? 谢谢!
...全文
582 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangcaibin 2006-11-13
  • 打赏
  • 举报
回复
下面是EXECUTE 的用法
PREPARE fooplan (int, text, bool, numeric) AS
INSERT INTO foo VALUES($1, $2, $3, $4);
EXECUTE fooplan(1, 'Hunter Valley', 't', 200.00);
klan 2006-11-09
  • 打赏
  • 举报
回复
不知,帮顶

57,065

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧