7 1 4 What if You Have a Prompt

LANSA Client

7.1.4 What if You Have a Prompt?

If you run a query in batch mode and it has been defined with a Prompt to request information, you can supply the selection criteria as a parameter via either:

  • the command line

or

The format of the parameter is:

QPnn=<parameter value>

where nn is the sequence number of the parameter and <parameter value> is the actual value to be used. This parameter is the equivalent of the Condition Prompt dialog box.

The prompt parameter which is equivalent to a Conditions Prompt dialog box requesting the Sales Country "AU" would be:  QP01=AU

If you do not include this parameter, the query will be completed using the default value.

If your query had more than one promptable value, you could enter the values like this:

LCRUN32.EXE CITY.LCQ /b QP01=AUSTRALIA QP03=10000

This command will run the CITY.LCQ query in batch mode with:

  • the first promptable/parameter value (QP01) set to AUSTRALIA.
  • the second promptable/parameter value (QP02) is not supplied so it would be set to its default.
  • the third promptable/parameter value (QP03) set to 10000.
  • If your promptable value contains a space, then enclose the parameter in quotes like this QP01="SOUTH AFRICA".

Note: If the parameter value contains an embedded quote, such as QP01=O"PSM, then the parameter must be supplied in an input file.

Further Information

Ý 7.1 How It Works