SQL解析失败,不知道问题出在哪里?
这解析得很好:
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME) VALUES (data.name);
这失败了:
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name, :P94_NUMBER num FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME, PERSON_NUMBER) VALUES (data.name, data.num);
错误消息是:
发生了 1 个错误 ORA-06550:第 10 行,第 51 列:PL/SQL:ORA-00923:在预期位置未找到 FROM 关键字 ORA-06550:第 9 行,第 1 列:PL/SQL:忽略 SQL 语句
This parses fine:
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME) VALUES (data.name);
This fails:
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name, :P94_NUMBER num FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME, PERSON_NUMBER) VALUES (data.name, data.num);
The error message is:
1 error has occurred
ORA-06550: line 10, column 51: PL/SQL: ORA-00923: FROM keyword not found where expected ORA-06550: line 9, column 1: PL/SQL: SQL Statement ignored
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题在于像您一样使用 PEOPLE.PERSON_NAME ,而不进行选择。尝试这样做:
I think the issue is with using PEOPLE.PERSON_NAME like you are, without a select. Try doing it like this: