By using Pass-through) You can submit SQL statements directly to the data source. You can submit SQL statements in the SQL language used by the data source. When you want to perform operations that are not possible with DB2 (r) SQL/API, use pass-through sessions. For example, you can use a pass-through session to create a process, create an index, or run a query in the local language of the data source.
Currently, data sources that support pass-through support SQL transmission. In the future, data sources may support pass-through ).
Similarly, you can use pass-through sessions to perform operations that are not supported by SQL statements (for example, some management tasks ). However, you cannot use pass-through sessions to execute all management tasks. For example, you can create or delete a table from a data source table, but cannot start or stop a remote database.
You can use both static and dynamic SQL statements in pass-through sessions.
The federated server provides the following SQL statements to manage pass-through sessions:
-
Set passthru
-
Open the pass-through session. When you issue another set passthru statement to start a new pass-through session, the current transfer session is terminated.
-
Set passthru Reset
-
Terminate the current pass-through session.
-
Grant (server privileges)
-
Authorize the user, group, and authorization ID list or public to start a pass-through session with a specific data source.
-
Revoke (server privilege)
-
Cancel the pass-through session permission.
The following restrictions apply to pass-through sessions:
- You must use the SQL language commands of the data source instead of the DB2 SQL language. Therefore, you do not query nicknames, but directly query the data source objects.
- When an update or delete operation is performed in a pass-through session, you cannot use the where current of cursor condition.
- 2Lob is not supported in pass-through sessions.