Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Posts
    49

    Unanswered: DB2 Stored Procedure Builder

    In DB2's stored procedure builder, when trying to build the SP

    CREATE PROCEDURE ASHA.PROCEDURE1 ( )

    ------------------------------------------------------------------------

    -- SQL Stored Procedure

    ------------------------------------------------------------------------

    P1: BEGIN

    declare getval integer;

    set getval=1;

    END P1



    I get an output as

    ASHA.PROCEDURE1 - Build started.
    Create stored procedure returns -7032.

    -- LOG FILE P2064661.log FOR PROCEDURE ASHA .PROCEDURE1

    -- DB2_SQLROUTINE_PREPOPTS=DATETIME ISO

    -- PREP/BIND MESSAGES FOR D:\IBM\SQLLIB\function\routine\sqlproc\MYDB\ASHA\t mp\P2064661.sqc
    -- PREP/BIND ERROR CODES: 0 -1

    -- END OF LOG FILE (SQLCODE: -1)

    ASHA.PROCEDURE1 - Build failed.
    ASHA.PROCEDURE1 - Roll back completed successfully.

    why this is happening???

    Thanks,
    Asha

  2. #2
    Join Date
    Feb 2003
    Posts
    49

    Re: DB2 Stored Procedure Builder

    I got that one solved, but here is where I am getting stuck!!!

    CREATE PROCEDURE ASHA.PROCEDURE1 ( )
    DYNAMIC RESULT SETS 2
    ------------------------------------------------------------------------
    -- SQL Stored Procedure
    ------------------------------------------------------------------------
    P1: BEGIN

    DECLARE cursor1 CURSOR WITH RETURN TO CALLER FOR

    select 'hello' from SYSIBM.SYSDUMMY1;

    OPEN cursor1;

    DECLARE cursor2 CURSOR WITH RETURN TO CALLER FOR
    select 'no hello' from SYSIBM.SYSDUMMY1;
    OPEN cursor2;

    END P1

    Regards,
    Asha

    Originally posted by asha192
    In DB2's stored procedure builder, when trying to build the SP

    CREATE PROCEDURE ASHA.PROCEDURE1 ( )

    ------------------------------------------------------------------------

    -- SQL Stored Procedure

    ------------------------------------------------------------------------

    P1: BEGIN

    declare getval integer;

    set getval=1;

    END P1



    I get an output as

    ASHA.PROCEDURE1 - Build started.
    Create stored procedure returns -7032.

    -- LOG FILE P2064661.log FOR PROCEDURE ASHA .PROCEDURE1

    -- DB2_SQLROUTINE_PREPOPTS=DATETIME ISO

    -- PREP/BIND MESSAGES FOR D:\IBM\SQLLIB\function\routine\sqlproc\MYDB\ASHA\t mp\P2064661.sqc
    -- PREP/BIND ERROR CODES: 0 -1

    -- END OF LOG FILE (SQLCODE: -1)

    ASHA.PROCEDURE1 - Build failed.
    ASHA.PROCEDURE1 - Roll back completed successfully.

    why this is happening???

    Thanks,
    Asha

  3. #3
    Join Date
    Jun 2003
    Posts
    38

    Question

    Hi Asha,

    There is no problem in the sample code u hv written. What I would suggest is that u simply build a procedure using wizard(DB2 Development Center). If you are not able to build even in that case, then you need to check the environment settings. I guess you have proper environment variable settings in DB2 system regirstry.

    If problem with environment variables, check the following :
    DB2_SQLROUTINE_COMPILER_PATH="C:\Program Files\Microsoft VisualStudio\VC98\bin\VCVARS32.BAT"

    DB2_SQLROUTINE_COMPILE_COMMAND="cl -Od -W2 /TC -D_X86_=1 -I%DB2PATH%\include SQLROUTINE_FILENAME.c /link -dll -defQLROUTINE_FILENAME.def /outQLROUTINE_FILENAME.dll %DB2PATH%\lib\db2api.lib"

    DB2PATH="C:\Program Files\IBM\SQLLIB"

    These settings are specific to Windows 2000/NT environment. Pl check the IBM DB2 manual for UNIX and other platforms.

    Also, check the following environment variables:
    INCLUDE=C:\ProgramFiles\IBM\SQLLIB\TEMPLATES\INCLU
    DE;C:\PROGRA~1\IBM\SQLLIB\INCLUDE;C:\Program Files\IBM\SQLLIB\LIB

    LIB=C:\PROGRA~1\IBM\SQLLIB\LIB

    PS: You must have C/C++ or VC++ compiler. I used VC++ 6.0 . As far as setting paths goes, plese check with your software installation.


    Thanks
    Raj Shekhar

Posting Permissions

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