?
Solved

'SP2-0158' Error received when trying to create SQLplus web report from command line

Posted on 2003-03-10
6
Medium Priority
?
2,416 Views
Last Modified: 2012-05-04
Hi,


I enter in the below command, following exactly Oracle documentation and get this error message:

sqlplus -S -M "HTML ON TABLE 'BORDER="2"'" me/IT@IT @test.sql > test.html

SP2-0158: unknown SET option "TABLE"
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= - | -? | [ [-M <o>] [-R <n>] [-S] ]
      <logon>  ::= <username>[/<password>][@<connect_string>] | / | /NOLOG
      <start>  ::= @<filename>[.<ext>] [<parameter> ...]
        "-" displays the usage syntax
        "-?" displays the SQL*Plus version banner
        "-M <o>" uses HTML markup options <o>
        "-R <n>" uses restricted mode <n>
        "-S" uses silent mode

Can anyone please help me out?
0
Comment
Question by:jtigas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8103044
Hi!

It's your multiple "", that does it.

Try -M "HTML ON TABLE 'BORDER=\"2\"'" instead of
-M "HTML ON TABLE 'BORDER="2"'"
OR even
-M "HTML ON TABLE 'BORDER=2'"

Regards
/Hans - Erik Skyttberg
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8105316
Which version you are running?
Set markup ... was introduced in version 8.1.6

If you have 8.1.6 or later
try the following

sqlplus -S  me/IT@IT @test.sql

where test.sql contains the following

SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD ' ' -
BODY 'TEXT="#FF00FF"' -
TABLE 'WIDTH="50%" BORDER="5"'

COLUMN WORKORDERNUMBER HEADING "WO NUMBER" ENTMAP OFF
SPOOL ./test.html

SELECT DISTINCT ASID.SECALTID    
FROM SPSH, ASID
WHERE SPSH.SECID=ASID.SECID
AND ASID.SECIDTYPE='PIP'
AND SPSH.BR='02';

SPOOL OFF
0
 

Author Comment

by:jtigas
ID: 8106858
Thanks for your quick responses!

I am running on Oracle version 8.1.6

I tried removing all those extra "" tick marks, but I still get the same Oracle error message:

SP2-0158: unknown SET option "TABLE"

And I also tried creating a script with everything in it and when I execute it from command line, it returns successfully, but the results are not in a table format.

Any ideas what could be wrong?  
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:heskyttberg
ID: 8106985
Hi!

I don't know what you are doing wrong, maybe you should upgrade, I tried the following with 9i and it worked without any problems:
sqlplus -S -M "HTML ON TABLE 'BORDER=2'" scott/tiger@myDB @test > test.html

Regards
/Hans - Erik Skyttberg
0
 
LVL 8

Accepted Solution

by:
heskyttberg earned 225 total points
ID: 8107007
Hi!

Where @test is a file called test.sql, you don't need to add the .sql when running a script.

This link might be somewhat useful explaining the command line parameters and thier use:
http://www.znow.com/sales/oracle/sqlplus.816/a75664/ch71.htm

Also you might try this, just to see if HTML markup is working:
sqlplus -M "HTML ON" scott/tiger@myDB

Then at sql prompt do:
select * from emp;

Just to see so you get HTML formatting.

Regards
/Hans - Erik Skyttberg
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8107720
at your unix command

prompt> which sqlplus

0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question