My Oracle Support Banner

Executing Script with Multiple Blanks Lines Results in Error ORA-00900 "Invalid sql statment" (Doc ID 432973.1)

Last updated on FEBRUARY 02, 2022

Applies to:

SQL*Plus - Version and later
Information in this document applies to any platform.


Executing a SQL script containing multiple blank lines between SQL statements fails with error:
ORA 00900: "invalid SQL statement."

This is usually seen when a View's definition is extracted from database using DBMS_METADAT package. The script file which contains extracted (DDL), contain blank lines.

For example consider the following statement to extract view definition and spool it to file:

Select dbms_metadata.get_ddl('VIEW','EMPVIEW','SCOTT') from dual;

This will show view definition for empview captured in a spooled file.

Create or Replace Force view "scott"."empview" ("empno","ename") as



Note: There are blank lines between empno and ename and between ename and from keyword.   There could be various reasons for these blank lines.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.