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

Advertisements

Comments, please?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s