Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    Richmond, VA
    Posts
    1

    Unanswered: having a hell of a time configuring db2 to use stored procedures!

    I am running db2 7.2 on AIX and I'm trying to use gcc as the compiler. First of all, does db2 support gcc on AIX??

    I will detail the configuration steps I've made:

    (the gcc executable is located in /usr/local/bin, which is already in $PATH)

    - created the file $HOME/myenv, which contains the single line 'export $PATH'

    - ran the following db2set commands:
    db2set db2_sqlroutine_compiler_path="$HOME/myenv"
    db2set db2_sqlroutine_compile_command="gcc -I$HOME/sqllib/include SQLROUTINE_FILENAME.c -shared -o SQLROUTINE_FILENAME -L$HOME/sqllib/lib -ldb2"

    Now, when I create a simple procedure, this is what I get:


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

    ARCHIVE.PROC1 - Create stored procedure returns -7032.

    ARCHIVE.PROC1:
    *** BIND /home/archive/sqllib/function/routine/sqlproc/OD_WEB/ARCHIVE/tmp/P5214850.sqc ***

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

    *** COMPILE /home/archive/sqllib/function/routine/sqlproc/OD_WEB/ARCHIVE/tmp/P5214850.c ***

    DB2_SQLROUTINE_COMPILER_PATH=/home/archive/myenv

    DB2_SQLROUTINE_COMPILE_COMMAND=gcc -I/home/archive/sqllib/include SQL_ROUTINE_FILENAME.c -shared -o SQL_ROUTINE_FILENAME -L/home/archive/sqllib/lib -ldb2

    export $PATH

    SQLROUTINE_FILENAME=P5214850
    export SQLROUTINE_FILENAME
    export SQLROUTINE_ENTRY=pgsjmp

    gcc -I/home/archive/sqllib/include SQL_ROUTINE_FILENAME.c -shared -o SQL_ROUTINE_FILENAME -L/home/archive/sqllib/lib -ldb2

    *** /home/archive/sqllib/function/routine/sqlproc/OD_WEB/ARCHIVE/tmp/P5214850.exp ***
    pgsjmp


    sh: /home/archive/sqllib/bin:/home/archive/sqllib/adm:/bin:: This is not an identifier.

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

    SQL7032N SQL procedure "PROC1" not created. Diagnostic file is
    "P5214850.log". SQLSTATE=42904



    ARCHIVE.PROC1 - Build failed.

    ARCHIVE.PROC1 - Changes rolled back.

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


    Where is that "sh: /home/archive/sqllib/bin:/home/archive/sqllib/adm:/bin:: This is not an identifier." line coming from? Is there a script somewhere that is picking this up??


    ALSO, when I use Stored Procedure Builder to create the procedure, and I try to open the 'SQL Stored Procedure Build Options", I receive the following error:

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

    [IBM][CLI Driver][DB2/6000] SQL10013N The specified library "/home/archive/sqllib/function/db2psmdr" could not be loaded.

    SQLCODE:-10013

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

    I know that db2psmdr deals with unfenced stored procedures. On my filesystem, db2psmdr is actually located in /home/archive/sqllib/function/unfenced/db2psmdr. But where can I set this??

    Would appreciate any help.....thanks!

  2. #2
    Join Date
    Apr 2002
    Posts
    188

    Re: having a hell of a time configuring db2 to use stored procedures!

    Hello,

    try using the Visual Age compiler from the IBM site, I tried configuring gcc on my AIX box and I could not make it work along with DB2/AIX.

    I set up the Visual Age compiler (v 5.0 i think) and now I can compile my stored procedures.

    marcos oliva



    Originally posted by simulant
    I am running db2 7.2 on AIX and I'm trying to use gcc as the compiler. First of all, does db2 support gcc on AIX??

    I will detail the configuration steps I've made:

    (the gcc executable is located in /usr/local/bin, which is already in $PATH)

    - created the file $HOME/myenv, which contains the single line 'export $PATH'

    - ran the following db2set commands:
    db2set db2_sqlroutine_compiler_path="$HOME/myenv"
    db2set db2_sqlroutine_compile_command="gcc -I$HOME/sqllib/include SQLROUTINE_FILENAME.c -shared -o SQLROUTINE_FILENAME -L$HOME/sqllib/lib -ldb2"

    Now, when I create a simple procedure, this is what I get:


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

    ARCHIVE.PROC1 - Create stored procedure returns -7032.

    ARCHIVE.PROC1:
    *** BIND /home/archive/sqllib/function/routine/sqlproc/OD_WEB/ARCHIVE/tmp/P5214850.sqc ***

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

    *** COMPILE /home/archive/sqllib/function/routine/sqlproc/OD_WEB/ARCHIVE/tmp/P5214850.c ***

    DB2_SQLROUTINE_COMPILER_PATH=/home/archive/myenv

    DB2_SQLROUTINE_COMPILE_COMMAND=gcc -I/home/archive/sqllib/include SQL_ROUTINE_FILENAME.c -shared -o SQL_ROUTINE_FILENAME -L/home/archive/sqllib/lib -ldb2

    export $PATH

    SQLROUTINE_FILENAME=P5214850
    export SQLROUTINE_FILENAME
    export SQLROUTINE_ENTRY=pgsjmp

    gcc -I/home/archive/sqllib/include SQL_ROUTINE_FILENAME.c -shared -o SQL_ROUTINE_FILENAME -L/home/archive/sqllib/lib -ldb2

    *** /home/archive/sqllib/function/routine/sqlproc/OD_WEB/ARCHIVE/tmp/P5214850.exp ***
    pgsjmp


    sh: /home/archive/sqllib/bin:/home/archive/sqllib/adm:/bin:: This is not an identifier.

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

    SQL7032N SQL procedure "PROC1" not created. Diagnostic file is
    "P5214850.log". SQLSTATE=42904



    ARCHIVE.PROC1 - Build failed.

    ARCHIVE.PROC1 - Changes rolled back.

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


    Where is that "sh: /home/archive/sqllib/bin:/home/archive/sqllib/adm:/bin:: This is not an identifier." line coming from? Is there a script somewhere that is picking this up??


    ALSO, when I use Stored Procedure Builder to create the procedure, and I try to open the 'SQL Stored Procedure Build Options", I receive the following error:

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

    [IBM][CLI Driver][DB2/6000] SQL10013N The specified library "/home/archive/sqllib/function/db2psmdr" could not be loaded.

    SQLCODE:-10013

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

    I know that db2psmdr deals with unfenced stored procedures. On my filesystem, db2psmdr is actually located in /home/archive/sqllib/function/unfenced/db2psmdr. But where can I set this??

    Would appreciate any help.....thanks!

Posting Permissions

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