[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2903
  • Last Modified:

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

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
jtigas
Asked:
jtigas
  • 3
  • 2
1 Solution
 
heskyttbergCommented:
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
 
HamdyHassanCommented:
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
 
jtigasAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
heskyttbergCommented:
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
 
heskyttbergCommented:
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
 
HamdyHassanCommented:
at your unix command

prompt> which sqlplus

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now