SWAP_DYNUSRPRF procedure
The SWAP_DYNUSRPRF procedure switches the SQL DYNUSRPRF setting for a program or service program. The possible values are *OWNER and *USER. Calling this procedure will change the value for a program or service program to the opposite setting. The switch will be performed for all modules in an ILE program or service program.
The following query shows the current value of the DYNUSRPRF setting for any modules that are
part of an ILE program or service
program:
SELECT SQL_DYNAMIC_USER_PROFILE FROM QSYS2.BOUND_MODULE_INFO
WHERE PROGRAM_LIBRARY = 'MYLIB' AND PROGRAM_NAME = 'MYPGM';
For
an OPM program, run the following
query:SELECT SQL_DYNAMIC_USER_PROFILE FROM QSYS2.PROGRAM_INFO
WHERE PROGRAM_LIBRARY = 'MYLIB' AND PROGRAM_NAME = 'MYPGM';
Authorization: The caller must have *ALLOBJ special authority or be authorized to the QIBM_DB_SECADM function usage ID.
The schema is QSYS2.
- program-library
- A character or graphic string containing the name of the library containing the program. Can be
one of the following special values:
- *CURLIB
- The job's current library is used.
- *LIBL
- The library list is used.
- program-name
- A character or graphic string containing the program name.
- program-type
- The object type for program-name.
- *PGM
- The object is a program.
- *SRVPGM
- The object is a service program.
Example
Switch the value of the dynamic user profile for program MYLIB/MYPGM.
CALL QSYS2.SWAP_DYNUSRPRF('MYLIB', 'MYPGM', '*PGM');