Previous Topic

Next Topic

Book Contents

Book Index

AQT scripting

In This Chapter

Startup script

Scripting functions

The scripting component of AQT allows you to run a set of SQL statements (and other AQT functions) without any prompting by AQT. This feature is useful for automating a series of queries and other functions.

AQT scripting is available for many AQT functions: these are detailed in Scripting Commands.

Scripting commands can be run from either:

Scripting syntax

The general syntax of an AQT scripting command is:

--aqt command,parameter=value,parameter=value

Example:

--aqt export,file=output.txt,type=csv,filemode=replace,prompt=no

All AQT scripting command start with -- (two minus signs), which is SQL syntax for a comment. This means that you can run your script using some other script processor (eg. SQLPlus, DB2 CLP etc) and the AQT script command will be ignored.

If your parameter value contains a comma, blank, or some other special character, you should enclose the value in double-quotes. The double-quote is used by the AQT batch processor to delimit values. Example:

--aqt export,file="customer data.txt",type=csv,filemode=replace,prompt=no

Functions and parameters are NOT case-sensitive.

Script Delimiter

By default, the SQL statements in your script are split into individual statements as per Options > Statement Delimiter.

You can specify another delimiter by used with the sdelim option. Eg.

--aqt options,sdelim=@

You would generally place this command at the start of the script