oracle tutorial webinars

ORA-00900 Error Message “Invalid SQL Statement”

Error ORA-00900 occurs when the user tries to execute a statement that is not a valid SQL statement. This error occurs if the Procedural Option is not installed and a SQL statement is issued that requires this option.

Users have several options in resolving error ORA-00900. You may choose to install the Procedural Option or correct the actual syntax.

To determine if you have installed the Procedural Option, open a session in Oracle by typing SQL*Plus. If the PL/SQL banner does not display, this means that the Procedural Option has not been installed. Otherwise, the PL/SQL banner should appear in a display window and contain a message with the following information:

SQL*Plus: [Version of release] – [Date of production: Day of week, month, day]

Copyright © [Copyright date], Oracle Corporation. All Rights Reserved.

[Further information on the connection]

Users may see error ORA-00900 when attempting to use a database link or when querying fields that may have worked previously. If faced with this situation, users should take the following steps.

On the local database, change the init.ora parameter NLS _ DATE _ FORMAT and use double quotation marks for the value. Using single quotation marks will cause Oracle to throw error ORA-00900 as this is not properly read and will become invalid. Always use double quotation marks. The database should then be restarted. For example, the statement should read:

NLS _ DATE _ FORMAT = “Day – Month – Year”

Another method is to alter the parameter within the session. This is done by an “alter session set” statement. The following is an example of such a statement:

SQL> alter session set NLS _ DATE _ FORMAT = “Day – Month – Year”;

To avoid seeing error ORA-00900 in the future, double check the syntax and spelling of your PL/SQL statements. Look over your error statement to get more clues on how to solve your error. Minimize the possibility of errors by using indentations and a color-coded IDE. If you continue to see error ORA-00900, you may try posting your code to an Oracle help forum. Likely, another Oracle user has faced the same or similar problems and has already posted the question to a forum. You may consider consulting your database administrator for help or even an outside expert. With any outside Oracle expert, make sure to check their certifications and experience to ensure they are professionals. For reference, see the Online Oracle documentation.