Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    7

    Arrow Unanswered: Stored Proc - Oracle to DB2 conversion

    Hi,

    I am looking for help in conversion of below Oracle to DB2 LUW 10.1 stored procedure... specifically first 4 lines.

    I have tried IBM migration toolkit, but no luck.

    ===============
    DECLARE
    type table_varchar
    IS
    TABLE OF VARCHAR2(20);
    type table_varchar2
    IS
    TABLE OF VARCHAR2(20);
    type table_varchar3
    IS
    TABLE OF VARCHAR2(50);
    type table_varchar4
    IS
    TABLE OF VARCHAR2(50);
    var_table_varchar table_varchar;
    var_table_varchar2 table_varchar2;
    var_table_varchar3 table_varchar3;
    var_table_varchar4 table_varchar4;
    BEGIN
    dbms_output.enable(1000000);
    var_table_varchar := table_varchar('dhy_ie','ina_ie');

    var_table_varchar2 := table_varchar2('uant','on');

    var_table_varchar3 := table_varchar3('uad@gmail.com','inar@gmail.com');

    var_table_varchar4 := table_varchar4('shn IE','esh IE');

    FOR elem IN 1 .. var_table_varchar.count
    LOOP
    dbms_output.put_line(elem || ': ' || var_table_varchar(elem));
    dbms_output.put_line('Loop Starts');
    DECLARE
    var_MO_EMPLOYEES_1SQ NUMBER(10);
    BEGIN
    dbms_output.put_line('Inside Begin Starts');
    SELECT
    MO_EMPLOYEES_1SQ.nextval
    INTO
    var_MO_EMPLOYEES_1SQ
    FROM
    dual;

    INSERT
    INTO
    SE_USER_B
    (
    USER_ID,
    EFF_BEGIN_DT,
    ARCHIVE_DT
    )
    VALUES
    ('sushant',
    TO_DATE('01-JAN-2011','DD-MON-RRRR'),
    TO_DATE('31-DEC-2999','DD-MON-RRRR')
    );


    dbms_output.put_line('Inside Begin Ends');
    END;
    dbms_output.put_line('Loop Ends');
    END LOOP;
    commit;
    END;
    ===============

    Any help is greatly appreciated.

    Thanks,
    Bala Surya.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    there are many samples in migration guide..
    what is the statement exactly doing (because we know db2 but not all from ora...)
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96

    Smile Database Conversion Workbench (DCW)

    Hello Suryadba,

    Migration Tool Kit (MTK) has been obsoleted for almost 2 years.
    Probably you may want to use the latest version for migrating from Oracle to DB2.

    IBM Database Conversion Workbench, Part 1: Overview

    You may contact the author of the article for help.

  4. #4
    Join Date
    Apr 2012
    Posts
    156
    You may have already seen this but a couple of things to look into:
    1. Run the db2 database in Oracle Compatibility mode. This removes the need to make changes to 99% of the code. I have used this mode and had tremendous success.
    2. Look at the following redbook:
    IBM Redbooks | Oracle to DB2 Conversion Guide: Compatibility Made Easy

Posting Permissions

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