Previous Topic

Next Topic

Book Contents

Book Index

Scripting - Queryparm

This function prompts the user for the values of User-Defined Parameters. The following parameters are available:

Once you define parameters (with either queryparm or setparm), AQT will scan all subsequent statements for reference to the parameters. Parameters are referred to by preceding the parameter name with a $.

Example 1:

--aqt queryparm,parm=sdate,desc=Start Date

select * from order_details where order_date > '$sdate'

Example 2:

--aqt queryparm,parm=user-id,desc=user-id,parm=pwd,desc=Password,pwd=y

--aqt connect,dbs=sample,user=$user-id,pwd=$pwd

See the file batch_parms.sql, which is deployed with AQT, for more examples of the use of parameters.

Restrictions

Select

This allows you to specify:

To specify a date picker, code one of:

To prompt the user for a file with the File Open or File Save dialog boxes, specify either:

To specify a drop down list, specify either:

Examples:

--aqt queryparm,parm=sdate,desc="Start Date",select=date,value=<date>

--aqt queryparm,parm=type,desc=Type,select=(T,P,S),value=T

--aqt queryparm,parm=order,desc="Order Number",select=(select distinct order_number from order_details),value=<1>

--aqt queryparm,parm=loadfile,desc="Enter file to load",select=fileopen,filedir="s:\AQT\loadfiles",filetype="Load files|*.csv"