This section lists some additional considerations that apply to SQL operations between DB2 for AS/400 and DB2 Client Server Version 2 or DB2 Universal Database Version 5. The rest of the discussion relates to DB2 for OS/2, but in most cases similar considerations apply to DB2 Client Server Version 2 and DB2 Universal Database Version 5 on other platforms, as follows:
OS/400 OS/400 OS/400 V2R3 V3R0.5 V3R1 PTF PTF PTF ------- ------- ------- SF23100 SF23950 SF23270 SF23205 SF23950 SF23277 SF23101 SF23994 SF23271 SF23722 SF23988 SF23721 SF23987 SF23986 SF23985 SF23990 SF23989 SF23960For OS/400 V3R1 you may need PTF SF23634, if you will be using DDCS or DB2 Connect. See item 3 and item 7.b.2 below.
If you will be using the SQL CALL statement to call stored procedures from DB2 for AS/400 to DB2 for OS/2, you need one of the following PTFs:
V3R1 V3R2 V3R6 V3R7 SF36701 SF36699 SF36700 SF33877
The symptom of this error is a "Distributed Relational Database Architecture (DRDA) protocol error" where the "Data descriptor did not match data" at the application requester (SQL code -30000, SQL state 58008).
For OS/400 V3R1 and V3R6 you will need to CALL DB2 for OS/2 procedures with the procedure name in a host variable as mentioned in item 13 (and item 12) below. For OS/400 V3R2 and V3R7 there are PTFs that allow you to embed the procedure name in the SQL statement without putting it into a host variable. These are:
V3R2 V3R7 SF36535 SF35932
To set up for APPC communications, do the following:
If your system will autocreate controllers, you can initiate the creation of the necessary controller descriptions. From the CM/2 folder on OS/2, Start Communications and run Subsystem Management. From Subsystem Management look at the details to the SNA subsystem. Here you can look at the Logical Links. Open that up and activate the link to the desired system to autocreate the controller there. The device description will automatically be created later.
CONNECT TO rdbname
BIND path@DDCS400.LST BLOCKING ALL SQLERROR CONTINUE MESSAGES DDCS400.MGS GRANT PUBLIC
Replace path in path@DDCS400.LST above with the default path C:\SQLLIB\BND\, or with your local value if you did not install to the default location.
Note: | PTF SF23624 is needed for OS/400 V3R1 to avoid a -901 SQL code from the DB2 for AS/400 database on the third bind file in the list. |
CONNECT RESET
GRANT ALL PRIVILEGES ON TABLE table-name TO user
GRANT EXECUTE ON PACKAGE package-name (usually the AS/400 program name) TO userPossibly, specify 'PUBLIC' for user.
Furthermore, in older versions of DB2 for OS/2, SQL packages would not be created for OS/400 programs that had anything in the text field of its source member description.