Coping with Failure

Errors in SQL statements occur for many reasons. Among the most common are

  • Typing mistakes

  • Syntax errors

  • Failing to include character data in quotes

  • Using an incorrect object name

Figure 3.4 illustrates these mistakes.

Figure 3.4. Common Errors in SQL Statements

When you type a statement that your version of SQL does not understand, the command will not be executed. Instead, the system will display some sort of error message on your screen, the helpfulness of which varies a great deal from system to system (and even within systems). A good error message tells you as much as possible about where you went wrong, including the type ...

Get Practical SQL Handbook, The: Using SQL Variants, 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.