4

I'm trying to execute a query with SQL*Plus (command line) that is a VIEW. SQL*Plus isn't supporting new lines or multiline comments ( /* -- */ ).

When I run set sqlblanklines on, it returns an error:

SQL> set sqlblanklines on
unknown SET option beginning "sqlblankli...".

So I ran 'help set' and it says that the command sqlblanklines (with an asterisk) is not supported by isql , but I'm using SQL*Plus indeed.

I don't know how to get rid of it, I've been frying my brain off about a couple days...

thanks in adv!!!


More details

The version is 8.0.6.0.0.

I'm running a script from a file. It shows many errors like this:

SQL> start /tmp/sql/pti/APPS.DIBVWIP001.sql 

The errors are like

   unknown command beginning "and msi.i..." - rest of line ignored. 
   unknown command beginning "and msi.o..." - rest of line ignored. 
   unknown command beginning "and bic.c..." - rest of line ignored. 
   unknown command beginning "and bbm.b..." - rest of line ignored. 
   For a list of known commands enter HELP and to leave enter EXIT. 

Before that block there's an blank line.. that's the point. I can't remove the blank lines from the scripts.

6
  • what error do you get when you try to run the query? Commented Aug 17, 2011 at 13:47
  • 1
    What version of SQLPlus are you running? Are you typing the query directly into SQLPlus or calling a script? Commented Aug 17, 2011 at 13:49
  • You know you are not allowed to use inline comments ? see: download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm Commented Aug 17, 2011 at 14:34
  • Well, the version is 8.0.6.0.0. I'm running a script from a file. It shows many errors like this "SQL> start /tmp/sql/pti/APPS.DIBVWIP001.sql unknown command beginning "and msi.i..." - rest of line ignored. unknown command beginning "and msi.o..." - rest of line ignored. unknown command beginning "and bic.c..." - rest of line ignored. unknown command beginning "and bbm.b..." - rest of line ignored. For a list of known commands enter HELP and to leave enter EXIT. " - Before that block there's an blank line.. that's the point. I can't remove the blank lines from the scripts.. =S Commented Aug 17, 2011 at 16:46
  • This article, Kevin, tells that I CAN comment a single inline ou multiple lines ... Commented Aug 17, 2011 at 16:51

1 Answer 1

3

You are working with an ancient version of the software. So it's no good looking at a modern version of the manual. If you consult the SQL*Plus User's Guide for Oracle 8.0.5 you will discover that SET doesn't support SQLBLANKLINES, which is what the error message told you.

I'm not sure why the multi-line comments are giving you grief: according to the documentation that should be supported. However, SQL*Plus - especially older versions - is sensitive to where we place the comments. It doesn't like comments which are placed too early in the DDL command. So if you're doing something like this ...

create  
/*  this is a comment
    which spans several lines
    oh yes
*/
or replace view my_view as select * from dual
/

... you might get some problems (although it runs fine in 11g).

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your reply. Look at header of the result of an forms compilation: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options PL/SQL Version 8.0.6.3.0 (Production) - Oracle is 10g but version of SQL*Plus seems to be 8. That is right ?
@Marcio - The database is a server application whereas SQLPlus is a client application. So it is perfectly possible for them to be out-of-sync; in fact it's almost inevitable in large organizations :( The database is certified to have backwards compatibility with older versions of SQLPlus. (The reverse is not true, advanced versions of the client may not play nice with older versions of the database.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.