Syntax
This section shows you the DBTools syntax in interactive, script and silent modes.
Execution – Interactive Mode
You can execute DBTools console from TAFJ_HOME/bin.
DBTools [-u <username> –p <password> -cf <configuration>[.properties]]
The targeted database is defined in the default configuration file or in the configuration file specified with the -cf option. The username and password must be passed along with –u and –p option respectively.
DBTools console also gives you the ability to launch a default command automatically. You need to add your command to the command line after the DBTools console is invoked and it will be executed by default.
DBTools [-u <username> –p <password> -cf <configuration>[.properties]] COMMAND
The example below shows how to launch a SQL command as default command when executing DBTools console.
Execution – Script Mode
You can also execute DBTools console in script mode without opening the console. You need to add -s option and the command you want to execute.
DBTools [-u <username> –p <password> -s [command] ]
The example below shows how to script a JQL command
And how to script a SQL command.
DBTools –u <username> -p <password> -s SQL SELECT \\* FROM FBNK_CURRENCY

The DBTools command on execution can produce different execution reports.
Default mode: Execution report buffered in DBTools console
By default without specifying any parameter, it is possible to open DBTools console and execute the command and result is appended to a buffer and displayed in the console at the end of the execution.

As mentioned above, when providing -s as parameter, script mode is enabled and it does not open DBTools console during execution. The execution report is appended live in the OS console.

When providing -log logFileName, execution report is redirected live to the related log file. This file is generated with .log extension under TAFJ_HOME/log.
The log mode can be associated to the script mode by combining -s and -log logFileName parameters. That is,
DBTools -u <username> –p <password> -s -log currencyId SQL SELECT RECID FROM FBNK_CURRENCY
In the above case, all FBNK_CURRENCY IDs is displayed in the OS console and is uploaded to currencyId.log under TAFJ_HOME/log.
The log mode can be associated to the console mode by providing a log file name in the DBTools console from the setup menu. The setup menu is available by typing setup on the command line. For more information, see the setup section.
Once the log file is setup, it is necessary to turn on the SPOOL feature to tell the console to display the result to the log file. You can do this by typing SPOOL on the command line. You will see that SPOOL is ON in the header of the console. By retyping SPOOL you can turn it off and disable the logging functionality. This way you can choose which command execution report you want to append to log file.
Silent mode: No execution report
When you pass the -silent parameter in script mode, command gets executed without generating any output.
DBTools -u <username> –p <password> -s -silent COMMAND
In this topic