使用 Oracle 中的两个表更新 SQL
我有这样的 sql
UPDATE A
SET A.TEMSILCI_KOD = 4
FROM S_MUSTERI A, S_TEKLIF B
WHERE A.TEMSILCI_KOD = 9
AND B.BAYI_KOD = 17
AND A.HESAP_NO = B.HESAP_NO
但我收到这样的错误
Error starting at line 8 in command:
UPDATE A
SET A.TEMSILCI_KOD = 4
FROM S_MUSTERI A, S_TEKLIF B
WHERE A.TEMSILCI_KOD = 9
AND B.BAYI_KOD = 17
AND A.HESAP_NO = B.HESAP_NO
Error at Command Line:9 Column:22
Error report:
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
ERROR
在哪里?
I have a sql like this
UPDATE A
SET A.TEMSILCI_KOD = 4
FROM S_MUSTERI A, S_TEKLIF B
WHERE A.TEMSILCI_KOD = 9
AND B.BAYI_KOD = 17
AND A.HESAP_NO = B.HESAP_NO
But i getting an error like this
Error starting at line 8 in command:
UPDATE A
SET A.TEMSILCI_KOD = 4
FROM S_MUSTERI A, S_TEKLIF B
WHERE A.TEMSILCI_KOD = 9
AND B.BAYI_KOD = 17
AND A.HESAP_NO = B.HESAP_NO
Error at Command Line:9 Column:22
Error report:
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Where is the ERROR
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许像
Maybe something like
在 Oracle 中,更新视图的语法与 SQL*Server 的语法不同。在 Oracle 中,您可以发出以下查询:
注意:此查询仅在
(S_TEKLIF.BAYI_KOD, S_TEKLIF.HESAP_NO)
唯一的情况下才在 Oracle 中工作(这样更新就不会含糊不清,并且来自的每一行)S_MUSTERI
最多更新一次)。In Oracle the syntax to update a view is different from SQL*Server's syntax. In Oracle you could issue the following query:
Note: This query will only work in Oracle if
(S_TEKLIF.BAYI_KOD, S_TEKLIF.HESAP_NO)
is unique (so that the update will not be ambiguous and each row fromS_MUSTERI
will be updated at most once).您的更新语句不遵循正确的语法。 update 语句中没有 from 子句。它应该遵循以下格式
请参阅有关更新的文档:
http://download.oracle.com/docs /cd/B19306_01/server.102/b14200/statements_10007.htm#i2067715
Your update statement does not follow the correct syntax. There is no from clause in the update statement. It should follow the format
See this documentation on update:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10007.htm#i2067715