Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Hei

RE: Hei

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Fri, 18 May 2001 19:19:25 -0700
Message-ID: <F001.003087E5.20010518191025@fatcity.com>

> -----Original Message-----
> From: Raymond Lee Meng Hong [mailto:RAYMOND_at_infopro.com.my]
>

>  I'm running Oracle 8.1.6. and using Sqlplus 3.2.2.

>
> I got a artical from internet is about setting the spool file
> to output as
> html
>
> here is the example
>
> SQL>set markup html on spool on
> ...
>
> But when I issue a set markup html on spool on ..
> the error "markup" not recognise come out ???

The SET command is a SQL*Plus command, so options on the SET command will only be valid for the corresponding value of SQL*Plus in which the feature was implemented.

SET MARKUP HTML was implemented in SQL*Plus 8.1.6.

Below is the extract from the manual describing the feature. (long)

MARK[UP] HTML [ON|OFF] [HEAD text] [BODY text] [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}] Outputs HTML marked up text. SET MARKUP has the same options and behavior as SQLPLUS -MARKUP and supports HTML 3.2.

The mandatory argument HTML specifies that the type of output generated by MARKUP is HTML. The optional HTML arguments, ON and OFF, specify whether or not to generate HTML output. SET MARKUP HTML ON generates HTML output using the specified MARKUP options, or options set by previous SET MARKUP HTML commands.

You can turn HTML output ON and OFF as required during a session. The default is OFF. 



Note:
SQL*Plus 8.1.6 implements the HTML <PRE> tag. More HTML tags may be implemented in future releases. 

  
You enable HTML output with the SPOOL ON option, and you initiate the writing of the spool file with the SPOOL command. You can specify <HEAD> tag contents and <BODY> attributes using the HEAD and BODY options.

The HEAD text option allows you to specify content for the <HEAD> tag. By default, text is '<TITLE>SQL*Plus Report</TITLE>'. If you enter more than one word in text, it must be enclosed in quotes. text must be valid HTML for the <HEAD> tag. SQL*Plus does not verify this free text entry. It is your responsibility to ensure that the text you enter is valid HTML.

The BODY text option allows you to specify attributes for the <BODY> tag. By default, there are no attributes. If you enter more than one word in text, it must be enclosed in quotes. text must be valid HTML for the <HEAD> tag. SQL*Plus does not verify this free text entry. It is your responsibility to ensure that the text you enter is valid HTML.

SPOOL ON or OFF specifies whether or not SQL*Plus writes HTML tags to the start and end of each file created by the SQL*Plus SPOOL command.

You can turn SPOOL ON and OFF as required during a session. The default is OFF. 



Note:
It is important to distinguish between the SET MARKUP HTML SPOOL option, and the SQLPLUS SPOOL filename command. 

The SET MARKUP HTML SPOOL ON option enables the writing of HTML tags to the spool file. The spool file is not created, and the tags enabled by the SET MARKUP HTML SPOOL ON option are not written to the spool file until you issue the SQLPLUS SPOOL filename command. 



 

 
SQL*Plus writes several HTML tags to the spool file with default content, when you issue the SQL*Plus SPOOL command:

          <HTML>
          <HEAD>
          <TITLE>SQL*Plus Report</TITLE>
          <META name="generator" content="SQL*Plus 8.1.6">
          </HEAD>
          <BODY>
          <PRE>


When you issue the SQL*Plus SPOOL OFF command, SQL*Plus appends the following end tags and then closes the file:

          </PRE></BODY></HTML>

ENTMAP ON or OFF specifies whether or not SQL*Plus displays the special characters "<", ">" and "&" as the HTML entities &lt;, &gt; and &amp; respectively.

You can turn ENTMAP ON and OFF as required during a session. The default is ON. For example, with ENTMAP OFF, SQL*Plus screen output would be:

          SQL> SELECT ENAME, EMPNO
            2  FROM EMP
            3  WHERE SAL <= 2000;


With ENTMAP ON, SQL*Plus screen output would be:

          SQL&gt; SELECT ENAME, EMPNO
            2  FROM EMP
            3  WHERE SAL &lt;= 2000;
  


--------------------------------------------------------------------------------
Note:
ENTMAP only has affect when either the HTML option is set ON, or the SPOOL option is set ON. 

 
PREFORMAT ON or OFF specifies whether or not SQL*Plus writes output inside the HTML <PRE> tag.

You can turn PREFORMAT ON and OFF as required during a session. The default is OFF. 



Notes:
In future releases of SQL*Plus, the HTML ON option may extend the HTML markup of reports.

If you want to write scripts that will always generate output inside a <PRE> tag, you should use the PREFORMAT ON option of the SET MARKUP HTML command to ensure future compatibility. For example: 

SET MARKUP HTML ON PREFORMAT ON
  Received on Fri May 18 2001 - 21:19:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US