SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Oracle Database Administration and PL/SQL Programming Tutorials for Data Professionals


ORA-00923: FROM keyword not found where expected

PL/SQL developers who run sql queries on Oracle database may experience the "ORA-00923: FROM keyword not found where expected" error. Although the ORA-00923 error is self describing the Oracle exception, it may be difficult especially for Transact-SQL (T-SQL) developers to solve ORA-00923 error.

For example, if you run following PL/SQL statement to display SysDate variable :

SELECT sysdate
Code

Oracle database developers will experience the error message :
ORA-00923: FROM keyword not found where expected

ora-00923-from-keyword-not-found-where-expected

But if the sql developer has experience on SQL Server T-SQL programming, he will execute following SQL Select statement successfully.

SELECT GETDATE()
Code




The difference between T-SQL and PL/SQL is PL/SQL developers have to use DUAL dummy table which has single row single column data which is build for such tasks. If as a developer, you place Dual table name after FROM clause in your PL/SQL Select statement, the query will run successfully.

The correct sql code for PL/SQL developers to use will be as follows:
PL/SQL developers should use Oracle Dual table in order to select system variable or to select data except from Oracle database table.

SELECT sysdate FROM Dual;
Code

This is one of the first hints for SQL developers who are new to PL/SQL but have experience on T-SQL programming.
In order to avoid ORA-00923: FROM keyword not found where expected error message, PL/SQL developers can Select system variables, or Select data that does not require an Oracle table FROM Dual table.



Oracle Database


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.