简体   繁体   中英

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:

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 . 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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