totn Oracle Error Messages

Oracle / PLSQL: ORA-00923 Error Message

Learn the cause and how to resolve the ORA-00923 error message in Oracle.

Description

When you encounter an ORA-00923 error, the following error message will appear:

  • ORA-00923: FROM keyword not found where expected

Cause

You tried to execute a SELECT statement, and you either missed or misplaced the FROM keyword.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

This error can occur when executing a SELECT statement that is missing the FROM keyword.

For example, if you tried to execute the following SELECT statement:

SELECT *
suppliers;

You could correct this SELECT statement by including the FROM keyword as follows:

SELECT *
FROM suppliers;

Option #2

This error can also occur if you use an alias, but do not include the alias in double quotation marks.

For example, if you tried to execute the following SQL statement:

SELECT owner AS 'owner column'
FROM all_tables;

You could correct this SELECT statement by using double quotation marks around the alias:

SELECT owner AS "owner column"
FROM all_tables;

Option #3

This error can also occur if you add a calculated column to a SELECT * statement.

For example, if you tried to execute the following SQL statement:

SELECT *, CAST((FROM_TZ(CAST(last_modified_date AS timestamp),'+00:00') at time zone 'US/Pacific') AS date) AS "Local Time"
FROM suppliers;

You could correct this SELECT statement by including the table name qualifier in front of the wildcard:

SELECT suppliers.*, CAST((FROM_TZ(CAST(last_modified_date AS timestamp),'+00:00') at time zone 'US/Pacific') AS date) AS "Local Time"
FROM suppliers;

Option #4

You can also generate this error by having an unbalanced set of parenthesis.

For example, if you tried to execute the following SQL statement:

SELECT COUNT(*)) AS "Total"
FROM suppliers;

You could correct this SELECT statement by removing the extra closing parenthesis just prior to the alias:

SELECT COUNT(*) AS "Total"
FROM suppliers;