版次注意事項


35.3 Chapter 7. Stored Procedures

|35.3.1 DECIMAL Type Fails in Linux Java Routines

|This problem occurs because the IBM Developer Kit for Java does |not create links for its libraries in the /usr/lib directory. The |security model for DB2 routines does not allow them to access libraries outside |of the standard system libraries. To enable DECIMAL support in Java routines |on Linux, perform the following steps: |

  1. |Create symbolic links from the IBM Developer Kit for Java libraries to /usr/lib/ by issuing the following command with root authority:

    |For IBM Developer Kit for Java 1.1.8:

    |   ln -sf /usr/jdk118/lib/linux/native_threads/* /usr/lib/

    |For IBM Developer Kit for Java 1.3:

    |   ln -sf /opt/IBMJava2-13/jre/bin/*.so /usr/lib/
  2. |Issue the ldconfig command to update the list |of system-wide libraries. |

|35.3.2 Using Cursors in Recursive Stored Procedures

|To avoid errors when using SQL Procedures or stored procedures written |in embedded SQL, close all open cursors before issuing a recursive CALL statement.

|For example, assume the stored procedure MYPROC contains the following |code fragment:

|   OPEN c1;
|   CALL MYPROC();
|   CLOSE c1;

|DB2 returns an error when MYPROC is called because cursor |c1 is still open when MYPROC issues a recursive CALL statement. The specific |error returned by DB2 depends on the actions MYPROC performs on the cursor.

|To successfully call MYPROC, rewrite MYPROC to close any open cursors before the nested CALL statement as shown in the |following example:

|OPEN c1;
|CLOSE c1;
|CALL MYPROC();

|Close all open cursors before issuing the nested CALL statement to avoid |an error.

35.3.3 Writing OLE Automation Stored Procedures

The last sentence in the following paragraph is missing from the second paragraph under section "Writing OLE automation Stored Procedures":

   After you code an OLE automation object, you must register the 
   methods of the object as stored procedures using the CREATE 
   PROCEDURE statement. To register an OLE automation stored 
   procedure, issue a CREATE PROCEDURE statement with the LANGUAGE 
   OLE clause. The external name consists of the OLE progID identifying 
   the OLE automation object and the method name separated 
   by ! (exclamation mark). The OLE automation object needs to be 
   implemented as an in-process server (.DLL).


[ 頁面頂端 | 前一頁 | 下一頁 | 目錄 | 索引 ]