Home » SQL & PL/SQL » Client Tools » SQL*Plus error
SQL*Plus error [message #530640] Wed, 09 November 2011 08:21 Go to next message
julb
Messages: 17
Registered: November 2010
Junior Member
Hi,

when I try to execute the following script using SQL*Plus
CREATE OR REPLACE FORCE VIEW "VIEW1" ("COLUMN1", "COLUMN2")
AS
  SELECT "COLUMN1",
    "COLUMN2"
  FROM "TABLE1"

  WHERE "COLUMN1" > 0;

I got this error -
SQL> @"c:\view1.sql";
SP2-0734: unknown command beginning "WHERE "COL..." - rest of line ignored.

It seems that if I remove the empty line before WHERE, it runs OK. By the way, SQL Developer executes it both ways.
Is there any way to make the original script (with empty line) work with SQL*PLUS?
We have a lot of views and most of them have these empty lines.
Re: SQL*Plus error [message #530641 is a reply to message #530640] Wed, 09 November 2011 08:26 Go to previous messageGo to next message
BlackSwan
Messages: 25795
Registered: January 2009
Location: SoCal
Senior Member
sqlplus does not like blank lines with single SQL statement
Re: SQL*Plus error [message #530643 is a reply to message #530640] Wed, 09 November 2011 08:32 Go to previous messageGo to next message
flyboy
Messages: 1850
Registered: November 2006
Senior Member
julb wrote on Wed, 09 November 2011 15:21
Is there any way to make the original script (with empty line) work with SQL*PLUS?

Yes, and fortunately it is shown in SQL*PlusĀ® User's Guide and Reference book, which is available with other Oracle documentation e.g. online on http://tahiti.oracle.com/ I suggest you to consult it. In the described case, the magic command is
SET SQLBLANKLINES ON
Re: SQL*Plus error [message #530644 is a reply to message #530640] Wed, 09 November 2011 08:32 Go to previous messageGo to next message
Michel Cadot
Messages: 65317
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Is there any way to make the original script (with empty line) work with SQL*PLUS?


Set SQLBLANKLINES ON


Regards
Michel
Re: SQL*Plus error [message #530645 is a reply to message #530641] Wed, 09 November 2011 08:34 Go to previous messageGo to next message
cookiemonster
Messages: 12990
Registered: September 2008
Location: Rainy Manchester
Senior Member
set sqlblanklines on
Re: SQL*Plus error [message #530651 is a reply to message #530645] Wed, 09 November 2011 08:41 Go to previous message
julb
Messages: 17
Registered: November 2010
Junior Member
Thanks flyboy and all the others - Set SQLBLANKLINES ON did the trick!
Previous Topic: TOAD error ORA-00900 Procedural Software Installation
Next Topic: Basic tools for Oracle version control: wanted!
Goto Forum:
  


Current Time: Thu Jan 18 17:03:41 CST 2018

Total time taken to generate the page: 0.01757 seconds