Skip to content

CONNECT QUERY

FUNCTION

This command enables you to connect to a Query-IV query, and display or print the query during script execution.

SYNTAX

CONNECT QUERY query-name$
query-name$
the name of a query created in Query-IV.

NOTES

  • This command enables you to connect to a Query-IV query from a script and to display or print the query.
  • After you query completes, execution resumes with the following Script-IV command.
  • The query is controlled by the values specified in the QUERY$[ALL] string array. If the array does not exist, Script-IV will automatically build the array. If the array exists, Script-IV will use the values in the array to control processing.
  • The arrays used by the CONNECT QUERY and CONNECT REPORT commands have the same structure. The script compiler uses the query-name$ parameter as the query name value, which is assigned to QUERY$[1].
  • The QUERY$[ALL] string array is described below:
QUERY$[ALL] Passed to query class from a script’s CONNECT QUERY command.
[0] Return status:
“.” On output, specifies normal query completion.
[1] Query library name. This can be a two-character library name, the complete library and query name, or a comma-separated string that contains the query name and entries that correspond to the following array entries. If the complete query name is provided, no entry is placed in this array for a “From query” value in QUERY$[2].
[2] From query.
[3] To query.
[4] Mask for query range.
[5] Sort number.
[6] Query device:
null Ask hardcopy question.
“Y” Ask hardcopy question.
N Terminal output only.
LP|P1|P2|Pn Printer device name.
OP Use operator’s default printer.
SP Use last printer opened by operator.
CH:str-val Use channel str-val for output.
CR Reserved.
/file-name Create or overwrite output to this file. Some extraneous characters may be captured after output text.
[7] Type output:
space PRINT.
P PRINT.
W WRITE.
R WRITERECORD.
N No output.
[8] Query mode:
“ “ Normal printing.
“D” Print detail lines only. D, CTnn, STnn, and CBnn lines will print. Header and footer lines will not print.
[9] Program to execute prior to printing each query detail line. For information on how to write such a program, please refer to the Query-IV Reference Manual.
[10] Window name for a user-provided window.

EXAMPLES

CONNECT QUERY "4SQSALES"

SEE ALSO

CONNECT HELP, CONNECT MENU, CONNECT REPORT, CONNECT SCREEN, CONNECT VIEW. For more information on queries see the Query-IV Reference Manual.

From the Script-IV Language Reference, version 8.9.1. Open this page in the PDF