Oracle SQL Developer: PL/SQL: ORA-00903: 无效的表名
我收到此错误:
Error starting at line 2 in command:
BEGIN
DELETE * FROM book_copies;
DELETE * FROM books;
/* more code here */
END;
Error report:
ORA-06550: line 2, column 10:
PL/SQL: ORA-00903: invalid table name
ORA-06550: line 2, column 3:
PL/SQL: SQL Statement ignored
ORA-06550: line 3, column 10:
PL/SQL: ORA-00903: invalid table name
ORA-06550: line 3, column 3:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
这很荒谬,因为两个表都存在于我的数据库中。我可以这样做:
SELECT * FROM books;
或者:
SELECT * FROM book_copies;
两者都有效。
为什么 Oracle SQL Developer 说“无效的表名”?
I am getting this error:
Error starting at line 2 in command:
BEGIN
DELETE * FROM book_copies;
DELETE * FROM books;
/* more code here */
END;
Error report:
ORA-06550: line 2, column 10:
PL/SQL: ORA-00903: invalid table name
ORA-06550: line 2, column 3:
PL/SQL: SQL Statement ignored
ORA-06550: line 3, column 10:
PL/SQL: ORA-00903: invalid table name
ORA-06550: line 3, column 3:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Which is ridiculous as both tables exist in my database. I can do:
SELECT * FROM books;
Or:
SELECT * FROM book_copies;
And both of them work.
Why does Oracle SQL Developer says "invalid table name"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在
DELETE
语句中,至少在 Oracle 中,您不会列出列,并且FROM
是可选的。因此,当您DELETE * ...
时,它会尝试将星号解析为表名。请注意,如果对列进行计数,第 10 列就是星号,这是报告无效表名的位置。编写
DELETE FROM book_copies
或DELETE book_copies
。In a
DELETE
statement, at least in Oracle, you don't list columns, andFROM
is optional. So when youDELETE * ...
, it is trying to parse the asterisk as the table name. Note that if you count the columns, column 10 is the asterisk, which is where the invalid table name is being reported.Write
DELETE FROM book_copies
orDELETE book_copies
.但你应该
(没有 * 借自 Access)
But you should
(no * borrowed from Access)
出现错误
drop 和 alter
相同的错误:表名无效,
但表存在,请告诉解决方案。
追问:
谢谢。
问候。
什韦塔
Getting error for
drop and alter
same error : invalid table name
but table is there, please tell the solution.
Query:
thanks.
regards.
Shweta