Friday, March 11, 2011

SQLPLUS - Spooling in HTML format

I used this recently and I thought of sharing this. If you don't know this already, SQL*PLUS has built in support for HTML. All you have to do is add markup option either on command line or inside the script. By the nature of it, it is only useful when you are spooling the output. Useful when you are dumping from multiple tables or generating simple reports. Just be aware that the output file will be larger than the usual text file spool.

Just add below to the script before spooling and the

SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD "<TITLE>E-App Validation Report</TITLE> -
<STYLE type='text/css'> -
<!-- BODY {background: #FFFFFF} --> -
</STYLE>" -
BODY "TEXT='#000FF'" -
TABLE "WIDTH='90%' BORDER='5'"

spool cleanup_eapp_data.html

No comments :

Post a Comment

I will be happy to hear your comments or suggestions about this post or this site in general.