This section contains information that may be useful in developing applications that use application servers which are not the same product as their application requesters.
All DB2 Universal Database™ products support extensions to IBM® SQL. Some of these extensions are product-specific, but many are already shared by more than one product or support is planned but not yet generally available.
For the most part, an application can use the statements and clauses that are supported by the database manager of the current server, even though that application might be running through the application requester of a database manager that does not support some of those statements and clauses. Restrictions to this general rule are identified by application requester:
Note that an 'R' in the table indicates that this SQL function is not supported in the specified environment. An 'R' in every column of the same row means that the function is available only if the current server and requester are the same product or that the statement is blocked by the application requester from being processed at the application server.
SQL Statement or Function | DB2 UDB for z/OS Application Server | DB2 UDB for iSeries Application Server | DB2 UDB LUW Application Server |
---|---|---|---|
COMMIT HOLD | R | R | R |
DECLARE STATEMENT | |||
DECLARE TABLE | |||
DECLARE VARIABLE | |||
DESCRIBE TABLE | R | ||
DESCRIBE with USING clause | R | ||
DISCONNECT | R | R | R |
BIGINT Data Types | R | 98 | 98 |
ROWID Data Types | R | ||
DATALINK Data Types | R | R | R |
BINARY and VARBINARY Data Types | R | R | R |
Host declarations not documented in language specific appendices | 99 | 99 | |
PREPARE with USING clause | R | ||
ROLLBACK HOLD | R | R | R |
SET CURRENT PACKAGESET | |||
SET variable | R | R | |
SET TRANSACTION | R | R | R |
Scrollable Cursor statements | R | R | R |
UPDATE cursor - FOR UPDATE clause not specified |
SQL Statement or Function | DB2 UDB for z/OS Application Server | DB2 UDB for iSeries Application Server | DB2 UDB LUW Application Server |
---|---|---|---|
COMMIT HOLD | R | R | |
DECLARE STATEMENT | |||
DECLARE TABLE | |||
DECLARE VARIABLE | |||
DESCRIBE TABLE | R | ||
DESCRIBE with USING clause | R | ||
DISCONNECT | |||
Host Variables - optional colon | R | R | R |
BIGINT Data Types | R | ||
ROWID Data Types | R | ||
DATALINK Data Types | R | R | |
BINARY and VARBINARY Data Types | R | R | |
Host declarations not documented in language specific appendices | 99 | 99 | |
PREPARE with USING clause | R | ||
ROLLBACK HOLD | R | R | |
SET CURRENT PACKAGESET | R | R | R |
SET variable | R | R | R |
SET TRANSACTION | R | R | |
Scrollable Cursor statements | R | R | |
UPDATE cursor - FOR UPDATE clause not specified | R |
SQL Statement or Function | DB2 UDB for z/OS Application Server | DB2 UDB for iSeries Application Server | DB2 UDB LUW Application Server |
---|---|---|---|
COMMIT HOLD | R | R | R |
DECLARE STATEMENT | R | R | R |
DECLARE TABLE | R | R | R |
DECLARE VARIABLE | R | R | R |
DESCRIBE TABLE | R | R | R |
DESCRIBE with USING clause | R | R | R |
DISCONNECT | |||
Host Variables - optional colon | R | R | R |
BIGINT Data Types | R | ||
ROWID Data Types | 100 | 100 | R |
DATALINK Data Types | R | R | R |
BINARY and VARBINARY Data Types | R | R | R |
Host declarations not documented in language specific appendices | 99 | 99 | |
PREPARE with USING clause | R | R | R |
ROLLBACK HOLD | R | R | R |
SET CURRENT PACKAGESET | |||
SET variable | R | R | R |
SET TRANSACTION | R | R | R |
Scrollable Cursor statements | R | R | R |
UPDATE cursor - FOR UPDATE clause not specified | R |
There are two types of CONNECT statements. They have the same syntax, but they have different semantics:
The following table summarizes the differences between CONNECT (Type 1) and CONNECT (Type 2) rules:
Type 1 Rules | Type 2 Rules |
---|---|
CONNECT statements can only be executed when the activation group is in the connectable state. No more than one CONNECT statement can be executed within the same unit of work. | There are no rules about the connectable state. More than one CONNECT statement can be executed within the same unit of work. |
If the CONNECT statement fails because the server name is not listed
in the local directory, the connection state of the activation group is unchanged.
If a CONNECT statement fails because the activation group is not in the connectable state, the SQL connection status of the activation group is unchanged. If a CONNECT statement fails for any other reason, the activation group is placed in the unconnected state. |
If a CONNECT statement fails, the current SQL connection is unchanged and any subsequent SQL statements are executed by the current server. |
CONNECT ends all existing connections of the activation group. Accordingly, CONNECT also closes any open cursors for that activation group. | CONNECT does not end connections and does not close cursors. |
A CONNECT to the current server will succeed if the application group is the connectable state. | A CONNECT to an existing SQL connection of the activation group is an error. Thus, a CONNECT to the current server is an error. |
A program preparation option is used to specify the type of CONNECT that will be performed by a program. The program preparation option is specified using the RDBCNNMTH parameter on the CRTSQLxxx command.
CONNECT (Type 2) connections to application servers that only support remote unit of work might result in connections that are read-only.
If a CONNECT (Type 2) is performed to an application server that only supports remote unit of work101:
If a CONNECT (Type 2) is performed to an application server that supports distributed unit of work: