Authorization
No authorization is required to use this statement. However to use OPEN
or FETCH for the cursor, the privileges held by the authorization ID of the
statement must include at least one of the following:
- For each table or view identified in the SELECT statement of the cursor:
- The SELECT privilege on the table or view, and
- The system authority *EXECUTE on the library containing the table or view
- Administrative authority
The SELECT statement of the cursor is one of the following:
- The prepared select-statement identified by the statement-name.
- The specified select-statement.
If statement-name is specified:
- The authorization ID of the statement is the run-time authorization ID
unless DYNUSRPRF(*OWNER) was specified on the CRTSQLxxx command when the program
was created. For more information, see Authorization IDs and authorization names.
- The authorization check is performed when the select-statement is
prepared unless DLYPRP(*YES) is specified on the CRTSQLxxx command.
- The authorization check is performed when the cursor is opened for programs
compiled with the DLYPRP(*YES) parameter.
If the select-statement is specified:
- If USRPRF(*OWNER) or USRPRF(*NAMING) with SQL naming was specified on
the CRTSQLxxx command, the authorization ID of the statement is the owner
of the SQL program or package.
- If USRPRF(*USER) or USRPRF(*NAMING) with system naming was specified on
the CRTSQLxxx command, the authorization ID of the statement is the run-time
authorization ID.
- In REXX, the authorization ID of the statement is the run-time authorization
ID.
- The authorization check is performed when the cursor is opened.
For information on the system authorities corresponding to SQL privileges,
see Corresponding System Authorities When Checking Privileges to a Table or View.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.