简体   繁体   English

无法在sqlplus中删除表

[英]Unable to drop table in sqlplus

I've been trying everything literally, the table exists but i just can't seem to be able to drop it. 我一直在尝试一切,表确实存在,但是我似乎无法删除它。 table is named 'student'. 该表被命名为“学生”。

DDL: DDL:

drop table student cascade constraints; 
drop table student;

Error: 错误:

ERROR at line 1: ORA-00942: table or view does not exist 

Find the schema name using the data dictionary : all_tables . 使用数据字典查找模式名称:all_tables。 And use the schema name/owner as a prefix to delete the table. 并使用架构名称/所有者作为删除表的前缀。

Select owner, TABLE_NAME from all_tables where table_name = 'STUDENT' 

Drop table <owner>.<table_name>   -- replace <owner> and <table_name> with proper values. 

Make sure that you are connected to the right database. 确保您已连接到正确的数据库。 Other possibilities are that there are foreign keys to student. 其他可能性是学生可以使用外键。 Check other table creation scripts to make sure that there are no lines like: 检查其他表创建脚本,以确保没有类似以下内容的行:

studentId References student(id)

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

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