管理数据库html页面,用Oracle的SQL工具创建HTML页面(原)

這是我在一個國外的網站上看到的

大家可以參考參考

SQL*Plus is primarily a character mode terminal application. However, since version 8.1.6, SQL*Plus has the ability to format its output in HTML format. To enable HTML output, use the command:

SQL> set markup html on

After it's turned on, several characters, such as >,

SQL> set markup html entmap off;

SQL>

When you issue a query, the results will be generated as an HTML TABLE, TR, and TD instead of as the usual formatted ASCII output:

SQL> select sysdate from dual;

SYSDATE

30-MAR-03

If you want to see the results as a preformatted HTML PRE element, use the option PREFORMAT ON:

SQL> set markup html preformat on;

SQL> select sysdate from dual;

 
 

SYSDATE

---------

30-MAR-03

If you specify SPOOL ON, SQL*Plus will generate headers to the spool file when you issue the SPOOL command.

You can change the HEAD tag contents, BODY tag, and TABLE tag attributes in the output by specifying those tag names as options:

SQL> set markup html head '' -

> body 'bgcolor="#FFFFFF"' -

> table 'width="100%" border=0'

SQL> select sysdate from dual;

SYSDATE

30-MAR-03

With MARKUP HTML ON enabled, the PAGESIZE, LINESIZE, TTITLE, BTITLE, and COLUMN commands are reflected in the HTML output.

You can enable MARKUP HTML commands and options from the command line, like this:

REM -- report.sql

select * from emp order by empno;

exit;

sqlplus -s -m "html on" scott/tiger @report > report.html

Using this method, you can run an old character mode SQL*Plus report and generate HTML without modifying the script.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值