Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2013
    Posts
    3

    Thumbs up Unanswered: Oracle Procedure convertion to DB2

    Please help me to convert the below to Db2, I wrote this on Oracle but I lack the DB2 knowledge.

    BEGIN
    DECLARE
    CURSOR crd_data
    IS
    SELECT B.ACCOUNT_NUMBER
    FROM CHK_XXX1.ACCT B;

    TYPE ARRAY IS TABLE OF crd_data%ROWTYPE;

    crd_data_ary ARRAY;
    BEGIN
    OPEN crd_data;

    LOOP
    FETCH crd_data BULK COLLECT INTO crd_data_ary LIMIT 1000;

    FOR i IN 1 .. crd_data_ary.COUNT
    LOOP
    INSERT INTO CHK_XXX2.ACCT (ACCOUNT_NUMBER)
    VALUES (crd_data_ary (i).ACCOUNT_NUMBER);
    END LOOP;

    COMMIT;
    EXIT WHEN crd_data%NOTFOUND;
    END LOOP;

    CLOSE crd_data;

    COMMIT;
    END;
    END;
    /

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    You may not need do much, if you enable the Oracle compatibility features in DB2, as described here: DB2 compatibility features introduction
    ---
    "It does not work" is not a valid problem statement.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •