Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    Atlanta GA, USA
    Posts
    9

    Unanswered: problems with building stored procedures

    When attempting to compile a stored procedure in DB2 using this script file:

    connect to CWORKS user CWCONNECT using a1phatap3
    @
    CREATE PROCEDURE CWCONNECT.ClearPassword(
    IN v_EmployeeID INT)
    LANGUAGE SQL
    BEGIN ATOMIC
    UPDATE Employee
    SET Password = ''
    WHERE EmployeeID = v_EmployeeID;
    END
    @
    COMMIT WORK
    @
    Connect reset
    @
    Terminate
    @


    The following error is generated:

    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL7032N SQL procedure "CLEARPASSWORD" not created. Diagnostic file is
    "P7492729.log". SQLSTATE=42904

    The .log file then follows:


    -- LOG FILE P7492729.log FOR PROCEDURE CWCONNECT.CLEARPASSWORD

    -- DB2_SQLROUTINE_PREPOPTS=

    -- PREP/BIND MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp\P7492729.sqc

    LINE MESSAGES FOR P7492729.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.b at



    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp\P7492729.BAT

    @echo on
    set SQLROUTINE_FILENAME=P7492729
    set db2path=C:\PROGRA~1\IBM\SQLLIB

    -- COMPILATION COMMAND:

    nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.ma k


    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp\P7492729.def

    LIBRARY P7492729
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8


    -- COMPILATION MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp\P7492729.c
    -- C COMPILATION ERROR CODES: 0 0 2

    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp>set SQLROUTINE_FILENAME=P7492729

    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp>set db2path=C:\PROGRA~1\IBM\SQLLIB

    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW ORKS\CWCONNECT\tmp>nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.ma k
    cl -Ox -W2 -TC -D_X86_=1 -MD -I"C:\PROGRA~1\IBM\SQLLIB\include" P7492729.c /link -dll /out:P7492729.dll -def:P7492729.def "C:\PROGRA~1\IBM\SQLLIB\lib\db2api.lib"

    Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
    Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

    NMAKE : fatal error U1077: 'cl' : return code '0x80'
    Stop.

    n END OF LOG FILE (SQLCODE: -7032)


    My environment is DB2 Personal Developers edition running on Microsoft XP Pro with 768 MB of RAM. My particular DB2 information is:

    DB21085I Instance "DB2" uses "32" bits and DB2 code release "SQL08012" with
    level identifier "02030106".
    Informational tokens are "DB2 v8.1.2.169", "s030508", "WR21318", and FixPak
    "2".
    Product is installed at "C:\PROGRA~1\IBM\SQLLIB".

    This procedure compiled with MS VC++ version 5 (or whatever come with Visual Studio 97), but give these errors with MS VC++ Version 6 with Service Pack 5 installed.

    Anyone having any idea, please forward them to me.

    Your help is greatly appreciated.

    Thank you,

    William Melvin
    V.P. Research and Development
    CollectionWorks International, Inc.

  2. #2
    Join Date
    Aug 2003
    Location
    Atlanta GA, USA
    Posts
    9

    Smile Resolution

    The resolution to the afore mentioned problem is to type the following command to set the DB2_SQLROUTINE_COMPILER_PATH.

    db2set DB2_SQLROUTINE_COMPILER_PATH="C:\Program Files\Microsoft Visual Studio\VC98\bin\vcvars32.bat"

    I was under the mistaken idea that DB2 would look at the environment settings to locate the appropriate routine. It obviously does not.

Posting Permissions

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