Generating sql reports to html

1 Mar

http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch7.htm

 

ALTERNATIV1 (creating report inside sql):

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

COLUMN DEPARTMENT_NAME HEADING ‘DEPARTMENT’ ENTMAP OFF

COLUMN CITY HEADING 'CITY'

SPOOL report.html

SELECT ‘<A HREF=”http://oracle.com/&#8217;||DEPARTMENT_NAME||’.html”>’||DEPARTMENT_NAME||'</A>’ DEPARTMENT_NAME, CITY

FROM EMP_DETAILS_VIEW 
WHERE SALARY>12000;

SPOOL OFF

 

ALTERNATIV2 (create report from sqlplus command):

SQLPLUS -S -M "HTML ON TABLE 'BORDER="2"'" HR@Ora10g @depart.sql>depart.html

An example of and little more advance html report with output:
http://www.idevelopment.info/data/Oracle/DBA_scripts/Database_Administration/dba_snapshot_database_10g.sql
http://www.idevelopment.info/data/Oracle/DBA_scripts/OUTPUT_REPORTS/dba_snapshot_database_10g.html

					
Advertisements

Leave a Reply

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

%d bloggers like this: