BrowserQueryRunner

ClipRunRightClick

RightClick

FourKey

  

 

Four-Key Clipboard Query Runner

ORIGINAL VERSION

How to create htm-formatted output for ANY adhoc sql query from anywhere in 4 key presses.

 

You are browsing the web, you suddenly find that little one liner
you have to see run at once.
All you need to do is copy the one-liner, press Fn+z
to save it and, press Fn+x to see a colorful htm formatted output.
If you have a PC/laptop with a hot-key assignment utility [like my Toshiba Satellite - Fn-esse], you can use it for hotkey assignments.
Don't forget to add Fn-esse to your startup folder so it is ready when you need it.
Or, you'll need to install Winkey or a similar tool before you can use this.
Here are the 5 steps to do the one-time configuration, after which, it would be
just 4 keypresses anytime.

 

 
STEP 1. Create c:\adhoc_edit.bat with 2 lines
:: =========================================================
:: Adhoc_Edit.bat
:: =========================================================
:: Jerome Christopher [Jerome_christopher@yahoo.com]
:: http://sqlhtm.blogspot.com
:: =========================================================
notepad c:\adhoc_paste.tmp
exit



STEP 2. Create c:\adhoc_paste.tmp with a 3-line reminder
 
:: =========================================================
:: Adhoc_Paste.tmp
:: =========================================================
:: Jerome Christopher [Jerome_christopher@yahoo.com]
:: http://sqlhtm.blogspot.com
:: =========================================================
:: Paste your oneliner/script/any select statement  above the EOP marker.
 

 

:: End of page...End of page...End of page...End of page...
:: END OF C:\ADHOC_PASTE.TMP SCRIPT
 
STEP 3. Create c:\adhoc_run.bat and change the connect string.
 
(
:: =========================================================
:: Adhoc_run.bat
:: =========================================================
:: Jerome Christopher [Jerome_christopher@yahoo.com]
:: http://sqlhtm.blogspot.com
:: http://www.sqlhtm.com/sqlhtm
:: =========================================================
echo set pages 1000 lines 200 echo off feedback off
echo prompt  ^<html^>^<head^>
echo set heading off feedback off
echo select '^<'^|^|'style type='^|^|''''^|^|'text'^|^|'^/'^|^|'css'^|^|''''^|^|'^>'^|^| chr^(10^)^|^|
echo 'body  {font:7pt bold Arial,Helvetica,sans-serif; color:black; background:^}'^|^|chr^(10^)^|^|
echo 'p     {font:bold 8pt Arial,Helvetica,sans-serif; color:black; background:}'^|^|chr^(10^)^|^|
echo 'table {font:8pt Arial,Helvetica,sans-serif; color:Black; background:#f7f7e7; vertical-align:top;}'^|^|chr^(10^)^|^|
echo 'tr    {font:bold 10pt Arial,Helvetica,sans-serif; color:red; background:#f7f7e7;}'^|^|chr^(10^)^|^|
echo 'td    {font:bold 7pt Arial,Helvetica,sans-serif; color:black; background:aqua;}'^|^|chr^(10^)^|^|
echo 'th    {font:bold 6pt Arial,Helvetica,sans-serif; color:white; background:olive; }'^|^|chr^(10^)^|^|
echo 'a     {font:8pt bold Arial,Helvetica,sans-serif; color:darkblue; background:; vertical-align:top;}'^|^|chr^(10^)^|^|
echo 'h1    {font:bold 14pt verdana,Helvetica,sans-serif; color:Black; background:; }'^|^|chr^(10^)^|^|
echo '^<'^|^|'^/'^|^|'style^>' from dual;
echo prompt ^<^/head^>^<body^>
echo SET MARKUP HTML ON TABLE ^"^" ENTMAP OFF  
echo select name,to_char^(sysdate,'dd-mon-yy hh:mi:ss pm Dy'^) Today from v$database;
echo SET HEADING ON
)>c:\adhoc_run.sql
type c:\adhoc_paste.tmp >>c:\adhoc_run.sql
echo exit >>c:\adhoc_run.sql
echo prompt ^<^/body^>^<^/html^> >>c:\adhoc_run.sql
sqlplus -s dba-user/pwd@db @c:\adhoc_run.sql >c:\adhoc_run.hta
start c:\adhoc_run.hta
exit



STEP 4. If you have Toshiba Satellite laptop use Fn-esse program to assign

a) Fn+z to start c:\adhoc_edit.bat
b) Fn+x to start c:\adhoc_run.bat

If you have other hotkey tools pre-existing in the PC use them or download a tool like WINKEY.


STEP 5. Start using it.

Press Fn+z  and paste/insert the query/queries above the end of page marker.
Save it and exit.

Press Fn+x and you have got a bright and colorful hta page of output.

 

   

Home

Scripts

Tips

Misc

Resume

Tamil

JobSearch

www.sqlhtm.com   Copyright. Jerome S. Christopher. 2010