Exploring Common SQL Errors

This section describes many common errors that you will receive while executing all types of SQL statements. Most are simple and make you want to kick yourself on the hind side, whereas other seemingly obvious errors are misleading.

Table or View Does Not Exist

When you receive an error stating that the table you are trying to access does not exist, it seems obvious—for example,

SQL> @tables.sql SQL> spool tables.lst SQL> set echo on SQL> set feedback on SQL> set pagesize 1000 SQL> select owner|| '.' || table_name 2 from sys.dba_table 3 where owner = 'SYSTEM' 4 order by table_name 5 / from sys.dba_table * ERROR at line 2: ORA-00942: table or view does not exist SQL> spool off SQL> mysql> select * from jobs -> ; ERROR ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.