Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    38

    Post Unanswered: Error Building DB2 SQL Procedure

    Hi All,

    I am trying to build a DB2 SQl Procedure using DB2 Development centre.On building the error occurs as :
    Command line error D2003 : missing source filename.

    For your reference I am giving you the steps I follwed :

    Database used : DB2 UDB v8.1(Evaluation copy).

    1. Insatalled VC++ 6.0
    2. Set Environment Variable (SYSTEM) DB2_SQLROUTINE_COMPILER_PATH=C:\Program Files\Microsoft Visual Studio\VC98\bin\vcvars32.bat
    3. Invoked DB2 Development Centre to create the SQl Store procedure. For your refernce I am also mentioning the steps taken thru :
    „« From the Develpoment Centre Launch Pad, created new project,added connection (Connection Type ˇVONLINE)
    „« Provided the user/pwd as db2admin/db2admin and then followed the steps directed by wizard to create the SQL procedure.
    4. In the output window I got Database connection as Success but the Build Status as : ˇ§ERRORˇ¨
    5. Below is the Build error:

    DB2ADMIN.PROCEDURE1 - Build started.

    Create stored procedure returns -7032.


    -- LOG FILE P1542576.log FOR PROCEDURE DB2ADMIN.PROCEDURE1

    -- DB2_SQLROUTINE_PREPOPTS=

    -- PREP/BIND MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp\P1542576.sqc


    LINE MESSAGES FOR P1542576.sqc

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

    SQL0060W The "C" precompiler is in progress.

    SQL0091W Precompilation or binding was ended with "0"

    errors and "0" warnings.


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

    -- DB2_SQLROUTINE_COMPILE_COMMAND=cl -Ox -W2 -TC -D_X86_=1 -MD

    -- CONTENTS OF C:\Program Files\Microsoft Visual Studio\VC98\bin\vcvars32.bat

    @echo off

    rem

    rem Root of Visual Developer Studio Common files.

    set VSCommonDir=C:\PROGRA~1\MICROS~2\Common



    rem

    rem Root of Visual Developer Studio installed files.

    rem

    set MSDevDir=C:\PROGRA~1\MICROS~2\Common\msdev98


    rem

    rem Root of Visual C++ installed files.

    rem

    set MSVCDir=C:\PROGRA~1\MICROS~2\VC98


    rem

    rem VcOsDir is used to help create either a Windows 95 or Windows NT specific path.

    rem

    set VcOsDir=WIN95

    if "%OS%" == "Windows_NT" set VcOsDir=WINNT



    rem

    echo Setting environment for using Microsoft Visual C++ tools.

    rem



    if "%OS%" == "Windows_NT" set PATH=%MSDevDir%\BIN;%MSVCDir%\BIN;%VSCommonDir%\TO OLS\%VcOsDir%;%VSCommonDir%\TOOLS;%PATH%

    if "%OS%" == "" set PATH="%MSDevDir%\BIN";"%MSVCDir%\BIN";"%VSCommonDi r%\TOOLS\%VcOsDir%";"%VSCommonDir%\TOOLS";"%windir %\SYSTEM";"%PATH%"

    set INCLUDE=%MSVCDir%\ATL\INCLUDE;%MSVCDir%\INCLUDE;%M SVCDir%\MFC\INCLUDE;%INCLUDE%

    set LIB=%MSVCDir%\LIB;%MSVCDir%\MFC\LIB;%LIB%



    set VcOsDir=
    set VSCommonDir=
    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp\P1542576.BAT

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

    -- COMPILATION COMMAND:

    cl -Ox -W2 -TC -D_X86_=1 -MD


    -- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp\P1542576.def

    LIBRARY P1542576
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8


    -- COMPILATION MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp\P1542576.c
    -- C COMPILATION ERROR CODES: 0 0 2
    Setting environment for using Microsoft Visual C++ tools.



    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp>set SQLROUTINE_FILENAME=P1542576



    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp>set db2path=C:\PROGRA~1\IBM\SQLLIB



    C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\TE ST_KON\DB2ADMIN\tmp>cl -Ox -W2 -TC -D_X86_=1 -MD

    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86

    Copyright (C) Microsoft Corp 1984-1998. All rights reserved.



    Command line error D2003 : missing source filename


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


    DB2ADMIN.PROCEDURE1 - Build failed.

    DB2ADMIN.PROCEDURE1 - Roll back completed successfully.
    Raj Shekhar

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Error Building DB2 SQL Procedure

    Have you tried running the CREATE PROCEDURE from a command line ...

    I know this is not the solution to your problem, but this might help in isolating the problem ...

    Cheers

    Sathyaram

  3. #3
    Join Date
    Jun 2003
    Posts
    38

    Thumbs up SQL Procedure compiled succesfully

    Hi ,
    I was able to compile SQL procedure from DB2 Devlopment center. We need to create following DB2 regirstry variables and set value as below:

    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
  •