ORA-00933: SQL 命令未正确结束(在简单插入语句中)
以下简单的语句:
INSERT INTO mydb.inventory (itemID) VALUES (:itemID) WHERE playerID = :ID;
生成以下错误:
ORA-00933: SQL command not properly ended
我已经尝试过不使用分号以及使用分号,但都给出了错误。我确信变量也被绑定了。
我所有的 Google 搜索都显示这通常是由 ORDER BY 子句引起的,但显然我没有。 =P
The following simple statement:
INSERT INTO mydb.inventory (itemID) VALUES (:itemID) WHERE playerID = :ID;
Generates the following error:
ORA-00933: SQL command not properly ended
I have tried it without the semi-colon as well as with, but both give me the error. I am certain that the variables are being bound as well.
All my Google searches show that this is usually caused by an ORDER BY clause, but clearly I don't have one. =P
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
仅当使用 SELECT 填充 INSERT 语句 时,才定义 WHERE 子句。 IE:
否则,按原样指定值:
更新现有记录时指定 WHERE 子句:
You only define a WHERE clause if you are populating the INSERT statement with a SELECT. IE:
Otherwise, you specify the values as-is:
You specify a WHERE clause when you are updating an existing record:
插入不能有 where 子句。也许您实际上是想
更新
?An insert can not have a where clause. Perhaps you actually meant to
update
?where
子句在insert
语句中相当不常见。也许您正在尝试更新?A
where
clause is rather unusual in aninsert
statement. Perhaps you're trying to update instead?