调用其参数中包含数组的 PostgreSQL 函数的语法
我正在测试一些我没有编写的 PostgreSQL 函数,其中一个函数的定义如下:
email_maker_for_new_work_order(integer, character varying, integer[]);
我试图这样调用它:
select email_maker_for_new_work_order(13987,"TEST_CeeLoGreen",['231822','267657','268399','270125','270127','270470','271320'])
但我收到错误:
ERROR: syntax error at or near "["
LINE 1: ..._maker_for_new_work_order(13987,"TEST_CeeLoGreen",['231822',...
^
********** Error **********
ERROR: syntax error at or near "["
SQL state: 42601
Character: 63
我尝试过在整数数组周围不使用单引号。但是,我在同一位置得到了基本相同的错误。
任何帮助将不胜感激。谢谢。
I am testing some PostgreSQL functions that I did not write, one of which is defined like:
email_maker_for_new_work_order(integer, character varying, integer[]);
I'm trying to call it like:
select email_maker_for_new_work_order(13987,"TEST_CeeLoGreen",['231822','267657','268399','270125','270127','270470','271320'])
But I get the error:
ERROR: syntax error at or near "["
LINE 1: ..._maker_for_new_work_order(13987,"TEST_CeeLoGreen",['231822',...
^
********** Error **********
ERROR: syntax error at or near "["
SQL state: 42601
Character: 63
I've tried without the single-quotes around the integer array. However, I get essentially the same error at the same location.
Any help would be appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
语法是
,请注意,参数不是
'42'
中的字符串,而是像42
这样的普通整数。顺便说一下:
"TEST_CeeLoGreen"
部分被解释为列名,而不是纯字符串。这是故意的吗?The syntax is
and note, that the arguments are not strings as in
'42'
but plain integers like42
.By the way: The part
"TEST_CeeLoGreen"
is interpreted as a column name, not as a plain string. Is that intended?