Problem in creating stored procedure in db2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • venu569
    New Member
    • Feb 2008
    • 1

    Problem in creating stored procedure in db2

    Hi,

    i am getting following error when i am trying to create stored procedures in db2.
    error is:
    Code:
    PROCEDURE2 - Build started.
    Create stored procedure returns -7032.
    
    -- LOG FILE P6191000.log FOR PROCEDURE ARTIAGARWAL.PROCEDURE2
    
    -- DB2_SQLROUTINE_PREPOPTS=
    
    -- PREP/BIND MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.sqc
    
    
    LINE    MESSAGES FOR P6191000.sqc
    
    ------  --------------------------------------------------------------------
    
            SQL0060W  The "C" precompiler is in progress.
    
            SQL0091W  Precompilation or binding was ended with "0" 
    
                      errors and "0" warnings.
    
    
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sr_cpath.bat
    
    
    
    
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.BAT
    
    @echo on
    set SQLROUTINE_FILENAME=P6191000
    set db2path=C:\PROGRA~1\IBM\SQLLIB
    
    -- COMPILATION COMMAND:
    
    nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.mak
    
    
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.def
    
    LIBRARY P6191000
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8
    
    
    -- COMPILATION MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.c
    -- C COMPILATION ERROR CODES: 0 0 1
    
    
    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp>set SQLROUTINE_FILENAME=P6191000 
    
    
    
    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp>set db2path=C:\PROGRA~1\IBM\SQLLIB 
    
    
    
    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\\tmp>nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.mak 
    
    'nmake' is not recognized as an internal or external command,
    
    operable program or batch file.
    
    
    -- END OF LOG FILE (SQLCODE: -7032)
    
    PROCEDURE2 - Build failed.
    PROCEDURE2 - Roll back completed successfully.
    Thanks
    GVG
    Last edited by docdiesel; Feb 27 '08, 02:25 PM. Reason: Added code tags
  • sakumar9
    Recognized Expert New Member
    • Jan 2008
    • 127

    #2
    Originally posted by venu569
    Hi,

    i am getting following error when i am trying to create stored procedures in db2.
    error is:
    Code:
    PROCEDURE2 - Build started.
    Create stored procedure returns -7032.
    
    -- LOG FILE P6191000.log FOR PROCEDURE ARTIAGARWAL.PROCEDURE2
    
    -- DB2_SQLROUTINE_PREPOPTS=
    
    -- PREP/BIND MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.sqc
    
    
    LINE    MESSAGES FOR P6191000.sqc
    
    ------  --------------------------------------------------------------------
    
            SQL0060W  The "C" precompiler is in progress.
    
            SQL0091W  Precompilation or binding was ended with "0" 
    
                      errors and "0" warnings.
    
    
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sr_cpath.bat
    
    
    
    
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.BAT
    
    @echo on
    set SQLROUTINE_FILENAME=P6191000
    set db2path=C:\PROGRA~1\IBM\SQLLIB
    
    -- COMPILATION COMMAND:
    
    nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.mak
    
    
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.def
    
    LIBRARY P6191000
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8
    
    
    -- COMPILATION MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp\P6191000.c
    -- C COMPILATION ERROR CODES: 0 0 1
    
    
    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp>set SQLROUTINE_FILENAME=P6191000 
    
    
    
    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\KBASE\ARTIAGARWAL\tmp>set db2path=C:\PROGRA~1\IBM\SQLLIB 
    
    
    
    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\\tmp>nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.mak 
    
    'nmake' is not recognized as an internal or external command,
    
    operable program or batch file.
    
    
    -- END OF LOG FILE (SQLCODE: -7032)
    
    PROCEDURE2 - Build failed.
    PROCEDURE2 - Roll back completed successfully.
    Thanks
    GVG
    '

    I am not sure if you checked the error code details. It says:

    PROCEDURE2 - Build started.
    Create stored procedure returns -7032.
    ----------------------------------------------------------------------------------------------------------------

    C:\Documents and Settings\Admini strator>db2 "? sql7032n"


    SQL7032N SQL procedure "<procedure-name>" not created. Diagnostic file
    is "<file-name>".

    Explanation:

    SQL Procedure "<procedure-name>" was not created. One of the following
    has occurred:
    * Support for SQL stored procedures is not installed and configured on
    this server. You need to have the IBM Data Server Client and a C
    compiler installed on the server to create SQL procedures. You may
    need to set the DB2 registry variable DB2_SQLROUTINE_ COMPILER_PATH to
    point to a script or batch file that contains environment settings
    for the C compiler on your platform.
    * DB2 failed to precompile or compile the SQL stored procedure. DB2
    creates an SQL procedure as a C program that contains embedded SQL.
    Errors not found during the initial parsing of the CREATE PROCEDURE
    statement can be found during the precompile or compile stage.

    For UNIX platforms, the full path of the file that contains diagnostic
    information is:

    $DB2PATH/function/routine/sqlproc/ \
    $DATABASE/$SCHEMA/tmp/"<file-name>"

    where $DATABASE represents the name of the database, and $SCHEMA
    represents the schema name of the SQL procedure.For Windows operating
    systems, the full path of the file that contains diagnostic information
    is:

    %DB2PATH%\funct ion\routine\sql proc\ \
    %DATABASE%\%SCH EMA%\tmp\"<file-name>"

    where %DATABASE% represents the name of the database, and %SCHEMA%
    represents the schema name of the SQL procedure.User response:

    Ensure that both a compatible C compiler and a DB2 Application
    Development Client are installed on the server. If a precompile or
    compile error occurred, refer to the messages from the precompiler or
    compiler in the diagnostic file "<file-name>".

    Ensure that the DB2 registry variable DB2_SQLROUTINE_ COMPILER_PATH is
    set to point to a script or batch file that sets up the C compiler
    environment. On a UNIX operating system, for example, you may create a
    script called "sr_cpath" in the
    /home/DB2INSTANCE/sqllib/function/routine directory. To set the DB2
    registry variable DB2_SQL_ROUTINE _COMPILER_PATH accordingly, issue the
    following command:

    db2set DB2_SQLROUTINE_ COMPILER_PATH =
    /home/DB2INSTANCE/sqllib/function/routine/sr_cpath

    sqlcode: -7032

    sqlstate: 42904

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

    Which platform and DB2 version are you working on??
    Last edited by docdiesel; Feb 27 '08, 02:28 PM. Reason: Added code tags

    Comment

    • docdiesel
      Recognized Expert Contributor
      • Aug 2007
      • 297

      #3
      Hi,

      first, I added some code tags for better readability.

      2nd, it says it can't find nmake.exe. Seems your programming environment isn't installed properly, or at least some env. variable isn't set.

      Regards,

      Bernd

      Comment

      Working...