简体   繁体   English

删除时出现Oracle 10g XE错误-ORA-00903:无效的表名

[英]Oracle 10g XE error on delete - ORA-00903: invalid table name

When I issue this select statement in the Oracle web console it returns all the rows in the table: 当我在Oracle Web控制台中发出以下select语句时,它将返回表中的所有行:

select * from sbus;

However when I issue this delete statement I receive an error message - ORA-00903: invalid table name 但是,当我发出此删除语句时,我收到一条错误消息-ORA-00903:无效的表名

delete * from sbus;

This table is very simple: 该表非常简单:

create table sbus
( id            number(11)          not null,
  sbu           varchar2(75 char)   not null,
  sbu_name      varchar2(250 char)  not null,
  constraint sbus_pk primary key (id)
    using index (create index sbus_px on sbus (id))
);

What is with the invalid table name error! 无效的表名错误是什么! And why are the records not deleted! 为何记录未删除!

if what you are trying to accomplish is to empty the table the command is something like: 如果您要完成的工作是清空表,则命令类似于:

truncate sbus;

if you are trying to delete some rows: 如果您要删除一些行:

delete from sbus where .....//put your condition

the * in your query is the problem. 您查询中的*是问题所在。

It should be: 它应该是:

DELETE FROM sbus;

(without star "*") (没有星号“ *”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM