GITQRYTMP -  SQL Query Data to Temp Table

<< Click to Display Table of Contents >>

Navigation:  Utility Commands >

GITQRYTMP -  SQL Query Data to Temp Table

Description

This CL general utility command is used to perform ad-hoc SQL queries to a physical file/outfile for use in your apps. iForGit uses the command to query source members. 

 

Command Example to query file QIWS/QCUSTCDT to file in QTEMP

GITQRYTMP SQL('select * from qiws/qcustcdt')   

          OUTFILE(QTEMP/SQLTMP0001)            

          EMPTYERROR(*YES) 

 

Parameters

 

SQL - The SQL query. Ex: SELECT * FROM QIWS/QCUSTCDT

 

OUTFILE - The output physical file created from the SQL query.

 

EMPTYERROR - The command will throw a CPF9898 escape message when no records are found. If this option is not used, there is a data area named SQLQRYCNT that gets created in QTEMP with the last query record cound. You can use this data area if you don't want to throw an escape message when no records selected from the query. Default - *YES

 

Options

*NO - Do not throw an escape message on empty query results file. Use SQLQRYCNT data area in QTEMP if you need to check for query results in this  case.

 

*YES - Throw a CPF9898 error message if no records were returned from the query. This message is an escape message that must be monitored for in RPG or CL programs as needed.