Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Work File using SQL iQuery (WRKIQRY) command presents you with a list of field (column) names for the given database file (table). From that list, you may query the file using all the fields or selecting the fields to appear in the output.
Most user who are not advanced SQL users, (as well as many advanced SQL users) prefer the ease-of-use that WRKIQRY provides to run SQL over the database.
Work File using SQL iQuery allows users to view the SQL statement before it is run by pressing F14 (shift+F2), to prompt the resulting RUNIQRY command (by pressing F4), or to run a Query immediately by pressing F10. Query's run using WRKIQRY include the LOG(*YES) parameter, resulting in the SQL statement being written to the joblog as a message.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | Database file | Qualified object name | Required, Positional 1 |
Qualifier 1: Database file | Name | ||
Qualifier 2: Library | Name, *CURLIB, *LIBL, *USER, *USRPRF | ||
RDB | Remote Database System | Character value, *LOCAL | Optional, Positional 2 |
USER | Remote Database User ID | Character value, *NONE, *USER, *USRPRF, *CURRENT | Optional, Positional 3 |
PWD | Remote Database Password | Character value, *NONE | Optional, Positional 4 |
APPTITLE | Title Text Line 1 | Character value, *DFT, *NONE | Optional, Positional 5 |
USRTITLE | Title Text Line 2 | Character value, *DFT, *NONE | Optional, Positional 6 |
Top |
Specifies the database file whose fields are displayed. If no library or *LIBL is specified, the library list is searched for the database file. The maximum length of a file name is 128 characters and is converted to a 10-character system object name automatically when a long name is specified.
This is a required parameter.
Qualifier 1: Database file to query
Qualifier 2: Library
Top |
Top |
Top |
Top |
Specifies an optional User-specified Title text for the WRKIQRY work with panel. This text is displayed on line 1 of the WRKIQRY panel. It is also passed to the SQL iQuery command.
Top |
Specifies an optional User-specified Title text for the WRKIQRY work with panel. This text is displayed on line 2 of the field list panel. It is also passed to the SQL iQuery command.
Top |
Example 1: Simple Command Example
WRKIQRY FILE(CUSTMAST)
This command generates and displays a list of fields contained in the CUSTMAST file (located on the library list) from which the user may select fields to be included in a SQL iQuery command.
Top |
Top |