Previous Topic

Next Topic

Book Contents

Book Index

Using idparm

The idparm parameter of queryparm allows you to set a parameter to a hidden value.

This is best explained with an example:

--aqt queryparm,parm=custname,idparm=custno,select=(select customer_name, customer_number from customers)

select * from orders where customer_number=$custno

The orders table needs to be queried by customer_number. However the user may not be familiar with customer numbers but only knows customers by their customer name. We wish to prompt the user by customer namer, but pass customer number to the query.

To acheive this, the select clause in queryparm returns two columns:

When the user selects a value from the dropdown list:

Specifying a list of values

If your select clause is a list of values, you use a colon to delimit the main and hidden values:

--aqt queryparm,parm=typename,desc=Type,idparm=typeid,select=(Table:T,View:V,Synonym:S)

Note

This feature only works if you select values from the dropdown list. If you type a value, AQT will not be able to set the idparm value and it will retain its existing value.

Advanced Query Tool
https://www.querytool.com
© 2023 Cardett Associates Ltd. All rights reserved.