Search code examples
sqloracledelete-row

ORA-00903 invalid table name error when deleting rows from a table


I have a table in oracle that I was to delete the contents of, but when I try to delete I get ORA-00903: invalid table name as if it didn't exist. I know it exists because selecting all the rows works.

here I describe the table then try and delete it:

SQL> describe mytest        
 Name                                      Null?    Type        
 ----------------------------------------- -------- ----------------------------        
 SERIES                                             VARCHAR2(100)       
 SHEET                                              VARCHAR2(150)       
 NORTH                                              FLOAT(126)      
 SOUTH                                              FLOAT(126)      
 EAST                                               FLOAT(126)      
 WEST                                               FLOAT(126)      

SQL> delete * from mytest;      
delete * from mytest        
       *        
ERROR at line 1:        
ORA-00903: invalid table name

Is it a problem with my code or the way I'm deleting?

Thanks


Solution

  • You have to remove * as below

    delete from mytest;