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 MAY 27, 2023

Applies to:

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

Symptoms

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
select
empno,

ename


from
emp

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

Cause

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
Symptoms
Cause
Solution


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