This form of the GRANT statement grants the privilege to access and use a specified data source in pass-through mode.
Invocation
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).
Authorization
The authorization ID of the statement must have either SYSADM or DBADM authority.
Refer to GRANT (Database Authorities), GRANT (Index Privileges), GRANT (Package Privileges), GRANT (Schema Privileges) and GRANT (Table, View, or Nickname Privileges) for other GRANT statements.
Syntax
>>-GRANT PASSTHRU ON SERVER--server-name----TO------------------> .-,------------------------------------. V | >-------+-+-------+---authorization-name--+--+----------------->< | +-USER--+ | | '-GROUP-' | '-PUBLIC--------------------------'
Description
The list of authorization IDs cannot include the authorization ID of the user issuing the statement (SQLSTATE 42502).
Examples
Example 1: Give R. Smith and J. Jones the privilege to pass through to data source SERVALL. Their authorization IDs are RSMITH and JJONES.
GRANT PASSTHRU ON SERVER SERVALL TO USER RSMITH, USER JJONES
Example 2: Grant the privilege to pass through to data source EASTWING to a group whose authorization ID is D024. There is a user whose authorization ID is also D024.
GRANT PASSTHRU ON SERVER EASTWING TO GROUP D024
The GROUP keyword must be specified; otherwise, an error will occur because D024 is a user's ID as well as the specified group's ID (SQLSTATE 56092). Any member of group D024 will be allowed to pass through to EASTWING. Therefore, if user D024 belongs to the group, this user will be able to pass through to EASTWING.