Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2007
    Posts
    4

    Unanswered: Unable to compile Sql stored procedures in DB2 with GCC

    I followed the intructions in the article mentioned below to setup DB2 with GCC.
    Article: Compiling DB2 UDB Stored Procedures with GCC on Windows
    Link: http://www.ibm.com/developerworks/db...306haungs.html

    But I still can't create stored procedure.

    I see the following error when I run sample procedure from the above article.
    >db2 -td! -v -fsample.clp
    I get a message "ERROR [42904] [IBM][DB2/NT] SQL7032N SQL procedure "TestProcedure" not created. Diagnostic file is "P4113320.log". SQLSTATE=42904"
    Error in Log:
    /usr/bin/dllwrap: /usr/bin/gcc exited with status 1
    And I don't see the .o or .dll file created.

    But when I run c:\bin\db2gcc.bat P4113320
    The .o and .dll get generated.

    Thanks
    RJ

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Why don't you use DB2 V8? DB2 does not compile LANGUAGE SQL procedures to C code any longer. Hence, you wouldn't have to fiddle around with compiler options etc.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Sep 2007
    Posts
    4
    We do have DB2 Universal Database Version 8.
    When I 1st tried to create a procedure I got this error.
    nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.ma k
    'nmake' is not recognized as an internal or external command,
    operable program or batch file.

    That is when I started looking online and found the folling links
    http://publib.boulder.ibm.com/infoce...buildfails.htm
    http://www.ibm.com/developerworks/db...306haungs.html

    I have to work with the DB2 version I have, as our clients use the same version.

    Thanks

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The error message indicates that you don't have "nmake" installed. You can either install that tool (which is the Windows-variation for "make"), or you compile the procedure without make/nmake. If your procedure is to be defined with LANGUAGE SQL, you have another alternative because no compiler is needed for that.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Sep 2007
    Posts
    4
    Yes my procedure is in Language SQL. Could you please tell me what is the alternative? how do I compile/create the procedure without make/nmake?

    Thanks

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Install the latest FixPak and try to re-create the stored procedure. (You should at least run DB2 V8.)
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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