BrowserQueryRunner

ClipRunRightClick

RightClick

FourKey

ColorCodeOrderByColumn

HtaPages

Click on the image for a bigger view

ColorCodeOrderBy.gif


Add
a different color
to the order by column
to make the output
look better.

ColorCodeOrderByColumn.bat
Add a different color to the order by column to make the output look better.


If you have a million columns in that report you produced yesterday, all with the same color, it is definitely worthwhile to add a different color to the order by column.

Click on the picture to see if you agree.


echo spool c:\ccobc.hta
:: =========================================================================
:: ColorCodeOrderByColumn.bat
:: Color-code the ORDER BY column in the query
:: =========================================================================
:: Jerome Christopher [Jerome_christopher@yahoo.com]
::
http://sqlhtm.blogspot.com
:: http://www.sqlhtm.com/sqlhtm
:: =========================================================================
:: Here is a technique to use for coloring the order by column values
:: Customize your favorite scripts with this technique!
:: =========================================================================
echo prompt  ^<html^>^<head^>
echo set pages 10 lines 180 echo off feedback off
echo set heading off feedback off termout off

echo select '^<'^|^|'style type='^|^|''''^|^|'text'^|^|'^/'^|^|'css'^|^|''''^|^|'^>'^|^| chr^(10^)^|^|
echo 'body  {font:10pt bold Arial,Helvetica,sans-serif; color:black; background:^}'^|^|chr^(10^)^|^|
echo 'p     {font:9pt  bold Arial,Helvetica,sans-serif; color:maroon; background:}'^|^|chr^(10^)^|^|
echo 'table {font:9pt  bold Arial,Helvetica,sans-serif; color:Black; background:#f7f7e7; vertical-align:top;}'^|^|chr^(10^)^|^|
echo 'tr    {font:9pt bold Arial,Helvetica,sans-serif; color:red; background:#f7f7e7;}'^|^|chr^(10^)^|^|
echo 'td    {font:9pt  bold Arial,Helvetica,sans-serif; color:black; background:aqua;}'^|^|chr^(10^)^|^|
echo 'th    {font:9pt  bold Arial,Helvetica,sans-serif; color:white; background:olive; }'^|^|chr^(10^)^|^|
echo 'a     {font:10pt bold Arial,Helvetica,sans-serif; color:darkblue; background:; vertical-align:top;}'^|^|chr^(10^)^|^|
echo '^<'^|^|'^/'^|^|'style^>' from dual;

echo prompt ^<^/head^>^<body^>
echo SET MARKUP HTML ON TABLE ^"^" ENTMAP OFF 
echo set heading on
echo select name,to_char^(sysdate,'dd-mon-yy hh:mi:ss pm Dy'^) Today from v$database;
echo prompt =================================================================
echo prompt Color-code the ORDER BY Column in the report.
echo prompt Customize as needed.
echo prompt =================================================================
echo prompt Tables And Their Block Sizes
echo prompt =================================================================

echo select substr^(table^_name^,1^,30^)  ^"TABLE^" ^,  ^'^<a^>^'^|^|blocks^|^|^'^<^/a^>^' ^"blocksDesc^" from all^_tables where blocks^>1000 order by blocks desc^;
)>c:\ccobc.sql
echo prompt ^<^/body^>^<html^>  >>c:\ccobc.sql
echo exit >>c:\ccobc.sql

sqlplus -s dba-user/pwd@db @c:\ccobc.sql
start c:\ccobc.hta
exit

   

Home

Scripts

Tips

Misc

Resume

Tamil

JobSearch

www.sqlhtm.com Copyright Jerome S. Christopher 2010