oracle| Create | page
Create an HTML page with Oracle's Sql*plus tool
Author: fenng
Oracle's Sql*plus tools have some interesting options, reasonable use, can give us unexpected consequences. One of the "-M" options can be created to create HTML reports that are useful in practical applications. Let's take a look at some of the options for Sql*plus (Oracle 8i):
C:\>sqlplus-
Usage: sqlplus [[<option>] [<logon>] [<start>]]
of which <option>:: =-| -? | [[M <o>] [r <n>] [-S]]
< login >:: = < user name >[/< password >][@<connect_string>] | / | /nolog
If we are in the actual application, to the Company's table for each month of the report HTML, with Sql*plus This feature is easy to do.
Examples are as follows:
We are prepared to process the Dept table in Scott Mode. Dept Table contents:
Sql> SELECT * FROM dept;
DEPTNO dname LOC
---------- -------------- -------------
Ten ACCOUNTING NEW YORK
DALLAS
SALES CHICAGO
OPERATIONS BOSTON
To output an HTML file at the system command line:
Save the following lines of statements in a. SQL script (for example, Q.sql):
SET ECHO off
SET FEEDBACK off
SELECT * FROM Dept;
SET ECHO on
SET FEEDBACK on
Exit
Then down at the command line, use the following command:
C:\> sqlplus-s-M "HTML on head Dept table contents" Scott/tiger @c:\q.sql>dept.html
A simple explanation for this command: where "-S" means silent mode, "-M" means the HTML markup option, and the "Head Dept Table content" can be used to customize a simple title. Then the command is followed by the database user name and password, executing the script and redirecting to the dept.html.
The output dept.html has the following contents (the blanks have been truncated):
Output files under Sql*plus
You can do this with the Set markup command in Sql*plus.
SET MARKUP
Usage: SET MARKUP HTML [on| OFF] [head text] [body text]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.