Application - Command Line

SQL scripts may be executed from the commandline without launching the Aqua Data Studio GUI. This allows scheduling the execution of scripts from an OS scheduler such as a Unix cron job or with Windows Task Scheduler. There are two files in the root install directory called "runscript.sh/bat" and "runscript-bundled.sh/bat". For more on command line use, see the Aqua Commands page.

An example of what you can do with this:

Every morning a cron job runs a script that queries for a set of data, lays out pivot or graph information, saves it to file and then emails the file to a set of people.

These are examples of how to run a script from the command line. If you type "runscript" from within the root install directory the usage will display, which follows.

Windows Usage:

runscript.bat "-cMy Connection" "-fc:\myscript.sql" "-oc:\myscript-out.txt" "-uusername" "-m100" "-htrue"

Example:

runscript.bat "-cSQL Server 2000 - 54" "-fc:\\scheduled-pivotgrid.sql"

Linux Usage:

runscript.sh "-cMy Connection" "-fc:\myscript.sql" "-oc:\myscript-out.txt" "-uusername" "-m100" "-htrue"

Example:

./runscript.sh "-cSQL Server 2000 - 54" "-f/home/currentusername/Documents/scheduled-pivotgrid.sql"

OS X Usage:

runscript.sh "-cMy Connection" "-fc:\myscript.sql" "-oc:\myscript-out.txt" "-uusername" "-m100" "-htrue"

Example:

./runscript.sh "-cSQL Server 2000 - 69" "-f/Users/currentusername/Documents/scheduled-pivotgrid.sql"

 Within OS X it is possible to create an iCal alarm event which is an Apple Script. This Apple Script can contain a wrapper for a shell that runs the runscript.sh.

See Also