HOW TO Create HTML Output from SQL*Plus

在日常的生產中,可能同一支report對很多人都是需要的,如果同時有很多人查詢同樣的報表會對系統性能有一定的影響,這樣我們可以用sql*plus來定時生成靜態的html實現相關的需求 可以參考相關網頁  http://www.dba-oracle.com/oracle_tips_html_sql_plus.htm


In Oracle there is a super-easy way to make your output display in HTML format.

This is a great tool for web-based ad-hoc query tools and you can collect input from the end-users, spool a query to SQL*Plus and then return the data as an HTML page.

For example, let's assume that your Web Form does an employee report of employee name and salary and you want to return the output as an HTML file, ready to include in the returning HTML response.

set termout off
set pages 999

SET MARKUP HTML ON TABLE "class=emp cellspacing=0" ENTMAP OFF

col emp_name format a30 heading "

Emp Name

"
col salary   format $999,999 heading "

Salary

"

spool my_html.htm

select
   emp_name,
   salary
from
   emp e;

spool off;

 

This will spool the HTML to the my_html.htm file, ready for you to return to the client.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29987/viewspace-51673/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29987/viewspace-51673/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值