Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
oracle| Create | page
Create an HTML page with Oracle's Sql*plus tool
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):
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
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
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.
Usage: SET MARKUP HTML [on| OFF] [head text] [body text]
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.