Normally, to run an SQL statement, you specify it on the SQL parameter of the RUNIQRY command as follows:
RUNIQRY SQL('SELECT * FROM QIWS/QCUSTCDT')
You can also save the SQL statement in a source member and recall it later, using the following syntax:
RUNIQRY SRCMBR(SAMPLE) SRCFILE(MYLIB/QSQLSRC)
A great feature in SQL iQuery allows users to store SQL statements in source member and more easily recall them. We call this our "SQL Macro" feature or simply, Macros.
Using the RUNIQRY command, users may run pre-defined SQL statements using the member name as a "macro" identifier. To do so, the member name is specified on the SQL parameter, prefixed with an asterisk. User-defined macros are stored in QMACSRC on the library list, whereas SQL iQuery's built-in macros are stored elsewhere. For example to run the SQL iQuery-provided USRPRF (User Profile Listing) macro, type the following:
This statement runs the SQL statement stored in the source member named USRPRF in the source file named QIQMACROS in the SQL iQuery product library.
There are a number of macros shipped with SQL iQuery (see below) and end-users may create their own. User-created Macros should be stored in source file QMACSRC in a library on the library list.
For example, if the source member named SAMPLE is created in source file QMACSRC and contains: SELECT * FROM QIWS/QCUSTCDT; then following RUNIQRY command could be used to run that SQL statement as follows:
When RUNIQRY is run, it first checks for the macro name as a member in QMACSRC on the library list. If it does not locate a member with that name, it then searches source file QIQMACROS in the SQL iQuery product library for the member.
The SQL iQuery product ships with the following Macros. Some are for testing/debugging the product and your system's setup but most are for daily use.
Click on the Macro name to view the SQL Statement being run for that Macro.
Powered by COZTOOLS find out more
Click on a name in the list to view its contents.
Source Viewer © 2004 Robert Cozzi, Jr. All rights reserved.
|ACTJOB||2017-03-21 16.47.29||491||List Active Jobs|
|ALLUSR||2017-03-21 16.47.29||433||List User Profiles|
|DB2PTF||2017-03-21 16.47.29||433||DB2 Group PTF Level|
|DFTPWD||2017-03-21 16.47.29||323||Check for Users Potentially with Default Password|
|DMGOBJ||2017-03-21 16.47.29||285||Damaged Objects Report|
|DSK||2017-03-21 16.47.29||426||Disk Unit Report|
|DSPJRN||2017-03-21 16.47.29||142||Display Journal|
|GRPPRF||2017-03-21 16.47.29||424||Group Profile Membership list|
|IBMBLOG||2017-03-21 16.47.29||421||IBM Db2 for i Blog Article Links|
|INTERACT||2017-03-21 16.47.29||249||All Interactive Jobs|
|JOBATTR||2017-03-21 16.47.29||33||Job Attributes|
|JOBLOG||2017-03-21 16.47.29||1941||Joblog table Function QSYS2.JOBLOG_INFO(...)|
|JOBSCD||2017-03-21 16.47.29||433||Check Job Scheduler Entry Last Submitted Status|
|JOBSCDE||2017-03-21 16.47.29||407||List Job Scheduler Entries|
|LASTUSED||2017-03-21 16.47.29||273||Program Last used Date/Time|
|LIBL||2017-03-21 16.47.29||434||Current Job''s Library List|
|LICPGM||2017-03-21 16.47.29||297||Installed License Programs (a better view)|
|MCHTYPE||2017-03-21 16.47.29||134||Machine Type,Model,Proc Group,Feature Code,Serial|
|MSGW||2017-03-21 16.47.29||251||List Jobs in MSGW (Message Wait) Status|
|OBJLIST||2017-03-21 16.47.29||4768||Object list using IBM's Object Statistics UDTF|
|OBJSTRUCT||2017-03-21 16.47.29||333||Exploded Object List (*MODULE and *SRVPGM list)|
|PTFBKPLVL||2017-03-21 16.47.29||405||Back-level Group PTFs|
|PTFGRP||2017-03-21 16.47.29||430||PTF Group Levels|
|SPCVAL||2017-03-21 16.47.29||440||Special Values Query|
|SYS||2017-03-21 16.47.29||323||System Information|
|SYSVAL||2017-03-21 16.47.29||428||System Values Listing|
|TCPIP||2017-03-21 16.47.29||430||TCP/IP Info|
|TOPHOGS||2017-03-21 16.47.29||410||Top Storage Hogs|
|TOPLIMITS||2017-03-21 16.47.29||317||Top 3 Consumption Points|
|USRGRP||2017-03-21 16.47.29||434||List User Profile Group Profiles|
|USRPRF||2017-03-21 16.47.29||447||List Non-IBM User Profiles|