Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschoen authored Feb 7, 2025
1 parent f62f019 commit 1494746
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,15 +689,29 @@ The following example queries all the records from table QIWS/QCUSCTDT and place

**Overview** - This CL command is a convenience command that can be used to run an SQL data selection query and create an outfile of resulting data.

**SQL** - Enter an SQL SELECT statement to query some specific data.
**SQL** - Enter an SQL SELECT statement to query some specific data.

**OUTFILE** - This is the output file/table where data gets selected in to via an SQL query. The table will get automatically created as a result of the query if it doesn't exist.
**PARMS** - SQL placeholder parameter names. Enter up to 30 parameter placeholder values you want to replace dynamiclly in your SQL statements at runtime. These are not required if you don't want to dynamic parameter replacement.

**EMPTYERROR** - This parameter determines whether a CPF9898 escape message is thrown if no records were selected by the query. *YES - Throw an escape message if no records. *NO - Don't throw an error if no records selected. Default - *YES
Ex: ```@@LIB``` for library or ```@@FILE``` for file.

**PROMPT** - This parameter will interactively prompt the RUNSQL statement if desired. Only use this parameter in an interactive 5250 session. *YES - Prompt for RUNSQL command. *NO - Do not prompt for RUNSQL. Default - *NO
**PARMVALS** - SQL parameter replacement values. Enter up to 30 replacement values you want to replace dynamiclly in your SQL statements at runtime. These values correspond with each placeholder value you set in the list of PARMS. These are not required if you don't want to dynamic parameter replacement.

Note: The following data areas are auto-created in the current job library QTEMP to track resulting query info. You can retreive a resulting record count or the name of the outfile to check for existence in case it didn't get created for some reason such as query failure.
Ex: ```QIWS``` for library or ```QCUSTCDT``` for file.

**OUTFILE** - This is the output file/table where data gets selected in to via an SQL query. The table will get automatically created as a result of the query if it doesn't exist.

**EMPTYERROR** - This parameter determines whether a CPF9898 escape message is thrown if no records were selected by the query. *YES - Throw an escape message if no records. *NO - Don't throw an error if no records selected. Default - *YES

**NAMING** - This parameter determines whether SQL format your queries are using. *SYS or *SQL.

**PROMPT** - This parameter will interactively prompt the RUNSQL statement if desired. Only use this parameter in an interactive 5250 session. *YES - Prompt for RUNSQL command. *NO - Do not prompt for RUNSQL. Default - *NO

**CRTIDCOL** - This parameter will allow adding of a unique identity column to your outfile table after it's created. Specify *YES to add a unique identifier to your table. Default is *NO.

**IDCOLNAME** - This parameter will allow naming of the new identify column if one is added. Default is ```RECID```.

Note: The following data areas are auto-created in the current job library QTEMP to track resulting query info. You can retreive a resulting record count or the name of the outfile to check for existence in case it didn't get created for some reason such as query failure.
```
SQLQRYCNT - Query result record count.
SQLQRYFIL - Output file created by the query.
Expand Down

0 comments on commit 1494746

Please sign in to comment.