Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: typos and grammar

...

Code Block
languagenone
for name in `cat tables.txt`; 
  do ./dbviscmd.sh -connection "oracle" -sql "@run cmdtest.sql \${table||$name||||nobind}\$; "; 
done

15:01:19  START Executing Command Line, Database Connection: oracle Database Type: ORACLE Catalog: null Schema: SYSTEM
15:01:20  INFO  Physical database connection acquired for: oracle  
15:01:20  RUNNING  [@run ...ntries||||nobind}$ - - secs]  
@run cmdtest.sql ${table||hr.countries||||nobind}$;
COUNTRY_ID  COUNTRY_NAME              REGION_ID  
----------  ------------------------  ---------  
AR          Argentina                 2          
AU          Australia                 3          
BE          Belgium                   1          
BR          Brazil                    2          
CA          Canada                    2          
CH          Switzerland               1          
CN          China                     3          
DE          Germany                   1          
DK          Denmark                   1          
EG          Egypt                     4          
FR          France                    1          
HK          HongKong                  3          
IL          Israel                    4          
IN          India                     3          
IT          Italy                     1          
JP          Japan                     3          
KW          Kuwait                    4          
MX          Mexico                    2          
NG          Nigeria                   4          
NL          Netherlands               1          
SG          Singapore                 3          
UK          United Kingdom            1          
US          United States of America  2          
ZM          Zambia                    4          
ZW          Zimbabwe                  4          
15:01:20  SUCCESS  [SELECT - 25 rows, 0.016 secs]  Result set fetched  
select * from hr.countries;
15:01:20  SUCCESS  [@run ...ntries||||nobind}$ - 0.016 secs]  Script processed  
@run cmdtest.sql ${table||hr.countries||||nobind}$;
15:01:20  END Execution 1 statement(s) executed, 25 row(s) affected, exec/fetch time: 0.016/0.012 secs   [1 successful, 0 errors]
java -cp /Users/ulf/work/github/dbvis/trunk/pureit/apps/dbvis/classes:/Users/ulf/work/github/dbvis/trunk/pureit/apps/dbvis/resources:/Users/ulf/work/github/dbvis/trunk/pureit/apps/dbvis/external/* -Xmx512M -Djava.awt.headless=true -Ddbvis.home=/Users/ulf/work/github/dbvis/trunk/pureit/apps/dbvis com.onseven.dbvis.DbVisualizerCmd -masterpw stairway -connection oracle -sql @run cmdtest.sql ${table||hr.regions||||nobind}$; 
15:01:23  START Executing Command Line, Database Connection: oracle Database Type: ORACLE Catalog: null Schema: SYSTEM
15:01:23  INFO  Physical database connection acquired for: oracle  
15:01:23  RUNNING  [@run ...egions||||nobind}$ - - secs]  
@run cmdtest.sql ${table||hr.regions||||nobind}$;
REGION_ID  REGION_NAME             
---------  ----------------------  
5          Australia               
6          South America           
1          Europe                  
2          Americas                
3          Asia                    
4          Middle East and Africa  
15:01:23  SUCCESS  [SELECT - 6 rows, 0.001 secs]  Result set fetched  
select * from hr.regions;
15:01:23  SUCCESS  [@run ...egions||||nobind}$ - 0.001 secs]  Script processed  
@run cmdtest.sql ${table||hr.regions||||nobind}$;
15:01:23  END Execution 1 statement(s) executed, 6 row(s) affected, exec/fetch time: 0.001/0.000 secs   [1 successful, 0 errors]

The command-line interface is called with the -sql option, specifying the client-side command @run. A DbVisualizer variable is passed to the @run command with the value taken from the shell variable. This DbVisualizer variable value is then available to the script executed by the @run command.

...

From time to time, you may want to use some SQL that you have tested in the GUI and run it in the command - line interface. You can generate the string with all parameters and paste that string on the command line or a script. Use menu option SQL Commander -> Generate Command for dbviscmd to open a dialog where you can specify the options. Some options are selected and some are disabled depending on the editor contents.

If you generate a command from an anonymous script (a script that has not been saved to a file) with more than one line, you will be prompted to save the file or to generate a temporary fileoneIf you generate the command from a file that is modified, you will be prompted to save the file before generating the command.

Besides In addition to the Command Line Options, there are a few settings in the dialog:

...