Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    78

    Unanswered: Stored Procedure compile error

    Hello,
    We have a db2 database in AIX db2 v7.2, fixpack 10a.
    I 'm using Stored Procedure Builder in my windows XP machine, and using this tool,i'm connecting to db to create SQL stored procedure.
    I'm using the wizard bu it gives me the error below:
    before the error,i'm pasting my procedure

    ************Procedure***********
    CREATE PROCEDURE DB2DVLP2.SQLsample ( )
    SPECIFIC DB2DVLP2.SQLsample
    RESULT SETS 1
    LANGUAGE SQL
    ------------------------------------------------------------------------
    -- SQL Stored Procedure
    ------------------------------------------------------------------------
    P1: BEGIN
    -- Declare cursor
    DECLARE cursor1 CURSOR WITH RETURN FOR
    SELECT
    DB2DVLP2.EMPLOYEE.EMPNO AS EMPNO,
    DB2DVLP2.EMPLOYEE.FIRSTNME AS FIRSTNME,
    DB2DVLP2.EMPLOYEE.MIDINIT AS MIDINIT,
    DB2DVLP2.EMPLOYEE.LASTNAME AS LASTNAME,
    DB2DVLP2.EMPLOYEE.WORKDEPT AS WORKDEPT,
    DB2DVLP2.EMPLOYEE.PHONENO AS PHONENO,
    DB2DVLP2.EMPLOYEE.HIREDATE AS HIREDATE,
    DB2DVLP2.EMPLOYEE.JOB AS JOB,
    DB2DVLP2.EMPLOYEE.EDLEVEL AS EDLEVEL,
    DB2DVLP2.EMPLOYEE.SEX AS SEX,
    DB2DVLP2.EMPLOYEE.BIRTHDATE AS BIRTHDATE,
    DB2DVLP2.EMPLOYEE.SALARY AS SALARY,
    DB2DVLP2.EMPLOYEE.BONUS AS BONUS,
    DB2DVLP2.EMPLOYEE.COMM AS COMM
    FROM
    DB2DVLP2.EMPLOYEE;

    -- Cursor left open for client application
    OPEN cursor1;

    END P1

    ******************************



    ***********error message in SPB messages window**********

    DB2DVLP2.SQLSAMPLE - Create stored procedure returns -7032.

    DB2DVLP2.SQLSAMPLE:
    *** BIND /home/db2dvlp2/sqllib/function/routine/sqlproc/SAMPLE/DB2DVLP2/tmp/P3305270.sqc ***

    LINE MESSAGES FOR P3305270.sqc
    ------ --------------------------------------------------------------------
    SQL0060W The "C" precompiler is in progress.
    SQL0091W Precompilation or binding was ended with "0"
    errors and "0" warnings.

    *** COMPILE /home/db2dvlp2/sqllib/function/routine/sqlproc/SAMPLE/DB2DVLP2/tmp/P3305270.c ***

    #!/bin/sh
    PATH=$PATH:/usr/vacpp/bin
    PATH=$PATH:/usr/ibmcxx/bin
    PATH=$PATH:/usr/lpp/xlC/bin
    export PATH

    SQLROUTINE_FILENAME=P3305270
    export SQLROUTINE_FILENAME
    export SQLROUTINE_ENTRY=pgsjmp

    xlC -I/home/db2dvlp2/sqllib/include P3305270.c -bE:P3305270.exp -e pgsjmp -o P3305270 -L/home/db2dvlp2/sqllib/lib -lc -ldb2

    *** /home/db2dvlp2/sqllib/function/routine/sqlproc/SAMPLE/DB2DVLP2/tmp/P3305270.exp ***
    pgsjmp


    xlC: 1501-265 C++ compiler is not installed or munch attribute ( = /usr/vacpp/exe/munch ) in the config file is incorrect.

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

    SQL7032N SQL procedure "" not created. Diagnostic file is "".



    DB2DVLP2.SQLSAMPLE - Changes rolled back.

    DB2DVLP2.SQLSAMPLE - Build failed.
    **********************************************


    The unix admins tell that there is C++ compiler in the AIx server.
    What can we do??
    How can i correct the error??

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    The DB2 Configuration for the C compiler is not setup properly. I am not familiar with AIX, but this same question seems to be asked about once a month. Look through the archives of this forum and you might get the exact answer you need.

    Andy

  3. #3
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    In AIX we had to do this and we use gcc

    db2set DB2_SQLROUTINE_COMPILE_COMMAND="gcc -g -I /home/instance/sqllib/include SQL_ROUTINE_FILENAME.c -o SQLROUTINE_FILENAME -L /home/instance/sqllib/lib/-ldb2 -shared"

Posting Permissions

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