Results 1 to 11 of 11
  1. #1
    Join Date
    Jul 2004
    Posts
    53

    Unhappy Unanswered: Building SQL SP: No luck in v7... Now trying v8

    So I could not build my first SQL sp in v7, so I decided to give v8 a try, as we will be migrating within the next month and maybe I should not fuss with a beast that will be dead in little time and, instead, worry about the younger beast -- hoping, mistakenly, it will be an easier task.

    OK, so I finish installing my UDB v8 brand new (every single option for both the server and the application client on the same box). I check to make sure that darn db2udp file is there... It is. So I go into my Development Center, create a new project, add my database connection... No problem. I then add a SQL stored procedure and try and build it. OK, NMAKE.EXE wasn't found, so I take mine (from my VS .NET installation) and copy it to \SQLLIB\BIN directory. Retry... Same story with CL.EXE. Once more... OK, they were both found, but now I am getting the following error:

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

    Any ideas?

    TIA!

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Until Stinger comes out, you need to have a C compiler on the Server where you build SQL SPs. It looks like you are installing DB2 on Windows. Look at this site. It might help...

    http://www-106.ibm.com/developerwork...306haungs.html

    Andy

  3. #3
    Join Date
    Jul 2004
    Posts
    53
    Quote Originally Posted by ARWinner
    Until Stinger comes out, you need to have a C compiler on the Server where you build SQL SPs. It looks like you are installing DB2 on Windows. Look at this site. It might help...

    http://www-106.ibm.com/developerwork...306haungs.html

    Andy
    Thank you, Andy. I was looking for something like this on the IBM site to no avail.

    I went ahead and followed the instructions carefully. I downloaded and installed Cygwin. However, when they ask you to test the installation by going into the bash and typying "gcc --version", I got the error:

    bash: gcc: command not found

    I decided to ignore that and continue by creating my batch and my sample procedure and compiling it, but this was the result:

    connect to ic2 user s6admin USING

    Database Connection Information

    Database server = DB2/NT 8.1.0
    SQL authorization ID = S6ADMIN
    Local database alias = IC2


    drop table result
    DB20000I The SQL command completed successfully.

    create table result (text VARCHAR(80))
    DB20000I The SQL command completed successfully.

    drop procedure TestProcedure
    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0204N "S6ADMIN.TESTPROCEDURE" is an undefined name. SQLSTATE=42704

    create procedure TestProcedure ()
    BEGIN
    insert
    into result (text)
    values ('If you can read this, it worked.');
    END
    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 "TESTPROCEDURE" not created. Diagnostic file is "P9191576.log". SQLSTATE=42904

    -- LOG FILE P9191576.log FOR PROCEDURE S6ADMIN .TESTPROCEDURE

    -- DB2_SQLROUTINE_PREPOPTS=

    -- PREP/BIND MESSAGES FOR F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P9191576.sqc

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

    -- DB2_SQLROUTINE_COMPILE_COMMAND="C:\Cygwin\db2gcc.b at SQLROUTINE_FILENAME"

    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sr_cpath.b at



    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P9191576.BAT

    @echo on
    set SQLROUTINE_FILENAME=P9191576
    set db2path=F:\PROGRA~1\IBM\SQLLIB

    -- COMPILATION COMMAND:

    "C:\Cygwin\db2gcc.bat P9191576"


    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P9191576.def

    LIBRARY P9191576
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8


    -- COMPILATION MESSAGES FOR F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P9191576.c
    -- C COMPILATION ERROR CODES: 0 0 1

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set SQLROUTINE_FILENAME=P9191576

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set db2path=F:\PROGRA~1\IBM\SQLLIB

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>"C:\Cygwin\db2gcc.bat P9191576"
    '"C:\Cygwin\db2gcc.bat P9191576"' is not recognized as an internal or external command, operable program or batch file.

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


    call TestProcedure
    SQL0440N No authorized routine named "TESTPROCEDURE" of type "PROCEDURE" having compatible arguments was found. SQLSTATE=42884

    select text from result

    TEXT

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


    0 record(s) selected.


    terminate
    DB20000I The TERMINATE command completed successfully.


    Help please!

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Obviously, gcc was not installed or setup properly. I personally have not used this method (we run DB2 under Linux), so I cannot give you anything specific on how to correct it. You need to look into Cygwin further and maybe do a complete install or redo the installation.

    Andy

  5. #5
    Join Date
    Jul 2004
    Posts
    53
    Quote Originally Posted by ARWinner
    Obviously, gcc was not installed or setup properly. I personally have not used this method (we run DB2 under Linux), so I cannot give you anything specific on how to correct it. You need to look into Cygwin further and maybe do a complete install or redo the installation.

    Andy
    You were right. Apparently, Cygwin did not install properly, so I just reinstalled it and the gcc --version command works as expected. However, when I try and compile, I still get the following. Why can't DB2 create the sp?

    connect to ic2 user s6admin USING

    Database Connection Information

    Database server = DB2/NT 8.1.0
    SQL authorization ID = S6ADMIN
    Local database alias = IC2


    drop table result
    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
    SQL0204N "S6ADMIN.RESULT" is an undefined name. SQLSTATE=42704

    create table result (text VARCHAR(80))
    DB20000I The SQL command completed successfully.

    drop procedure TestProcedure
    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
    SQL0204N "S6ADMIN.TESTPROCEDURE" is an undefined name. SQLSTATE=42704

    create procedure TestProcedure ()
    BEGIN
    insert
    into result (text)
    values ('If you can read this, it worked.');
    END
    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 "TESTPROCEDURE" not created. Diagnostic file is "P0035986.log". SQLSTATE=42904

    -- LOG FILE P0035986.log FOR PROCEDURE S6ADMIN .TESTPROCEDURE

    -- DB2_SQLROUTINE_PREPOPTS=

    -- PREP/BIND MESSAGES FOR F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P0035986.sqc

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

    -- DB2_SQLROUTINE_COMPILE_COMMAND="C:\Cygwin\db2gcc.b at SQLROUTINE_FILENAME"

    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sr_cpath.b at



    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P0035986.BAT

    @echo on
    set SQLROUTINE_FILENAME=P0035986
    set db2path=F:\PROGRA~1\IBM\SQLLIB

    -- COMPILATION COMMAND:

    "C:\Cygwin\db2gcc.bat P0035986"


    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P0035986.def

    LIBRARY P0035986
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8


    -- COMPILATION MESSAGES FOR F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P0035986.c
    -- C COMPILATION ERROR CODES: 0 0 1

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set SQLROUTINE_FILENAME=P0035986

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set db2path=F:\PROGRA~1\IBM\SQLLIB

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>"C:\Cygwin\db2gcc.bat P0035986"
    '"C:\Cygwin\db2gcc.bat P0035986"' is not recognized as an internal or external command, operable program or batch file.

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


    call TestProcedure
    SQL0440N No authorized routine named "TESTPROCEDURE" of type "PROCEDURE" having compatible arguments was found. SQLSTATE=42884

    select text from result

    TEXT

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


    0 record(s) selected.


    terminate
    DB20000I The TERMINATE command completed successfully.


    Thanks once again.

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    OK, now that you have gcc installed properly, DB2 needs to know about it.
    Look at the "Most important step" on the url I posted earlier. Make sure that the db2set DB2_SQLROUTINE_COMPILE_COMMAND points to where you installed cygwin and gcc, not as it is shown on the url (unless that is how you did the install).

    Andy

  7. #7
    Join Date
    Jul 2004
    Posts
    53
    Quote Originally Posted by ARWinner
    OK, now that you have gcc installed properly, DB2 needs to know about it.
    Look at the "Most important step" on the url I posted earlier. Make sure that the db2set DB2_SQLROUTINE_COMPILE_COMMAND points to where you installed cygwin and gcc, not as it is shown on the url (unless that is how you did the install).

    Andy
    This is frustrating, isn't it? If it's frustrating for me, I bet it's even more frustrating for you.

    I didn't skip that step. This is what I get when I do a db2set without parameters:

    DB2_SQLROUTINE_COMPILE_COMMAND=c:\cygwin\db2gcc.ba t SQLROUTINE_FILENAME
    DB2_ENABLE_LDAP=YES
    DB2INSTPROF=F:\Program Files\IBM\SQLLIB
    DB2COMM=TCPIP


    (Note there is no space in the db2gcc.bat file extension as it's showing on this page for some reason.)

    And here's my batch file contents:

    setlocal

    REM Set the DB2PATH variable to your DB2 base path, e.g., c:\ibm\sqllib
    set DB2PATH="f:\program files\ibm\sqllib"

    REM Set CYGWIN to <strong>your</strong> top-level CYGWIN directory.
    set CYGWIN=c:\cygwin

    gcc -c -g -mno-cygwin -I%DB2PATH%\include -I%CYGWIN%\usr\include %1.c -o %1.o
    sed -e s/\_// %1.def > %1_m.def

    dllwrap -mno-cygwin -target i386-mingw32 -o %1.dll %1.o %DB2PATH%\lib\db2api.lib --def %1_m.def


    What am I missing? DB2 still cannot create my sp.

    Thanks, Andy.

  8. #8
    Join Date
    Jul 2004
    Posts
    53
    OK, I think I found the problem!

    In the batch file, I replaced the

    set DB2PATH="f:\program files\ibm\sqllib"

    ... by ...

    set DB2PATH=f:\progra~1\ibm\sqllib

    I re-ran the sample file and finally it added the one "If you can read this, it worked." line to my table. However, I received a bunch of errors in the process. Are these normal?

    (My message is too long, so I will break the log in 2 posts. Here's the first one.)

    c:\Cygwin\db2gcc.bat P1003768


    -- CONTENTS OF F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P1003768.def

    LIBRARY P1003768
    EXPORTS _pgsjmp@8
    pgsjmp=_pgsjmp@8


    -- COMPILATION MESSAGES FOR F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp\P1003768.c
    -- C COMPILATION ERROR CODES: 0 0 1

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set SQLROUTINE_FILENAME=P1003768

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set db2path=F:\PROGRA~1\IBM\SQLLIB

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>c:\Cygwin\db2gcc.bat P1003768

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>setlocal

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>REM Set the DB2PATH variable to your DB2 base path, e.g., c:\ibm\sqllib

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set DB2PATH="f:\program files\ibm\sqllib"

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>REM Set CYGWIN to <strong>your</strong> top-level CYGWIN directory.

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>set CYGWIN=c:\cygwin

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>gcc -c -g -mno-cygwin -I"f:\program files\ibm\sqllib"\include -Ic:\cygwin\usr\include P1003768.c -o P1003768.o

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>sed -e s/\_// P1003768.def 1>P1003768_m.def

    F:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\IC 2\S6ADMIN\tmp>dllwrap -mno-cygwin -target i386-mingw32 -o P1003768.dll P1003768.o "f:\program files\ibm\sqllib"\lib\db2api.lib --def P1003768_m.def
    P1003768.c:14:21: sqladef.h: No such file or directory
    P1003768.c:16: error: variable `sqla_rtinfo' has initializer but incomplete type

    P1003768.c:17: error: extra brace group at end of initializer
    P1003768.c:17: error: (near initialization for `sqla_rtinfo')
    P1003768.c:17: warning: excess elements in struct initializer
    P1003768.c:17: warning: (near initialization for `sqla_rtinfo')
    P1003768.c:17: error: `wchar_t' undeclared here (not in a function)
    P1003768.c:17: warning: excess elements in struct initializer
    P1003768.c:17: warning: (near initialization for `sqla_rtinfo')
    P1003768.c:17: warning: excess elements in struct initializer
    P1003768.c:17: warning: (near initialization for `sqla_rtinfo')
    P1003768.c:17: error: extra brace group at end of initializer
    P1003768.c:17: error: (near initialization for `sqla_rtinfo')
    P1003768.c:17: warning: excess elements in struct initializer
    P1003768.c:17: warning: (near initialization for `sqla_rtinfo')
    P1003768.sqc:10:20: sqlenv.h: No such file or directory
    In file included from /usr/include/w32api/sql.h:13,
    from P1003768.sqc:11:
    /usr/include/w32api/sqltypes.h:17: error: syntax error before "UDWORD"
    /usr/include/w32api/sqltypes.h:18: error: syntax error before "UWORD"
    /usr/include/w32api/sqltypes.h:24: error: syntax error before "PTR"
    /usr/include/w32api/sqltypes.h:25: error: syntax error before "HENV"
    /usr/include/w32api/sqltypes.h:26: error: syntax error before "HDBC"
    /usr/include/w32api/sqltypes.h:27: error: syntax error before "HSTMT"
    /usr/include/w32api/sqltypes.h:29: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sqltypes.h:34: error: syntax error before "SQLUINTEGER"
    /usr/include/w32api/sqltypes.h:36: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sqltypes.h:37: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sqltypes.h:50: error: syntax error before "SQLHWND"
    /usr/include/w32api/sqltypes.h:51: error: syntax error before "BOOKMARK"
    /usr/include/w32api/sqltypes.h:71: error: syntax error before "SQLTCHAR"
    /usr/include/w32api/sqltypes.h:84: error: syntax error before "SQLBIGINT"
    /usr/include/w32api/sqltypes.h:85: error: syntax error before "SQLUBIGINT"
    /usr/include/w32api/sqltypes.h:90: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sqltypes.h:94: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sqltypes.h:96: error: syntax error before "second"
    /usr/include/w32api/sqltypes.h:100: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sqltypes.h:102: error: syntax error before "hour"
    /usr/include/w32api/sqltypes.h:103: error: syntax error before "minute"
    /usr/include/w32api/sqltypes.h:104: error: syntax error before "second"
    /usr/include/w32api/sqltypes.h:105: error: syntax error before "fraction"
    /usr/include/w32api/sqltypes.h:108: error: syntax error before "SQL_DATE_STRUCT"

    /usr/include/w32api/sqltypes.h:109: error: syntax error before "SQL_TIME_STRUCT"

    /usr/include/w32api/sqltypes.h:110: error: syntax error before "SQL_TIMESTAMP_STRUCT"
    /usr/include/w32api/sqltypes.h:118: error: syntax error before "SQLUINTEGER"
    /usr/include/w32api/sqltypes.h:122: error: syntax error before "SQLUINTEGER"
    /usr/include/w32api/sqltypes.h:124: error: syntax error before "minute"
    /usr/include/w32api/sqltypes.h:125: error: syntax error before "second"
    /usr/include/w32api/sqltypes.h:126: error: syntax error before "fraction"
    /usr/include/w32api/sqltypes.h:132: error: syntax error before "SQL_YEAR_MONTH_STRUCT"
    /usr/include/w32api/sqltypes.h:135: error: syntax error before '}' token
    /usr/include/w32api/sqltypes.h:138: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sqltypes.h:140: error: syntax error before "sign"
    /usr/include/w32api/sqltypes.h:141: error: syntax error before "val"
    /usr/include/w32api/sqltypes.h:142: error: syntax error before '}' token
    /usr/include/w32api/sqltypes.h:154: error: syntax error before "DWORD"
    /usr/include/w32api/sqltypes.h:156: error: syntax error before "Data3"
    /usr/include/w32api/sqltypes.h:157: error: syntax error before "Data4"
    /usr/include/w32api/sqltypes.h:158: error: syntax error before '}' token
    In file included from P1003768.sqc:11:
    /usr/include/w32api/sql.h:346: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:348: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:349: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:351: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:352: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:357: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:358: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:360: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:362: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:363: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:364: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:365: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:366: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:367: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:368: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:369: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:370: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:372: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:373: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:374: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:375: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:376: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:377: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:378: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:379: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:382: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:384: error: syntax error before "SQLUSMALLINT"
    /usr/include/w32api/sql.h:389: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:390: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:391: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:393: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:394: error: syntax error before "SQLCHAR"
    /usr/include/w32api/sql.h:395: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:396: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:397: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:398: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:400: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:401: error: syntax error before "SQLPOINTER"
    /usr/include/w32api/sql.h:402: error: syntax error before "SQLPOINTER"
    P1003768.sqc:12:19: sqlda.h: No such file or directory
    P1003768.sqc:13:21: db2psmd.h: No such file or directory
    P1003768.sqc:58: error: variable `psmBlankSQLCA' has initializer but incomplete type

  9. #9
    Join Date
    Jul 2004
    Posts
    53
    P1003768.sqc:60: error: extra brace group at end of initializer
    P1003768.sqc:60: error: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:60: warning: excess elements in struct initializer
    P1003768.sqc:60: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:61: error: invalid application of `sizeof' to an incomplete type
    P1003768.sqc:61: warning: excess elements in struct initializer
    P1003768.sqc:61: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:61: warning: excess elements in struct initializer
    P1003768.sqc:61: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:61: warning: excess elements in struct initializer
    P1003768.sqc:61: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:62: error: extra brace group at end of initializer
    P1003768.sqc:62: error: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:68: warning: excess elements in struct initializer
    P1003768.sqc:68: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:69: error: extra brace group at end of initializer
    P1003768.sqc:69: error: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:69: warning: excess elements in struct initializer
    P1003768.sqc:69: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:70: error: extra brace group at end of initializer
    P1003768.sqc:70: error: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:70: warning: excess elements in struct initializer
    P1003768.sqc:70: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:71: error: extra brace group at end of initializer
    P1003768.sqc:71: error: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:71: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:71: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:71: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:71: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:72: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:72: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:72: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:72: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:73: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:73: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:73: error: `SQL_NO_WARN' undeclared here (not in a function)
    P1003768.sqc:73: warning: excess elements in struct initializer
    P1003768.sqc:73: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:74: error: extra brace group at end of initializer
    P1003768.sqc:74: error: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:74: warning: excess elements in struct initializer
    P1003768.sqc:74: warning: (near initialization for `psmBlankSQLCA')
    P1003768.sqc:140: error: syntax error before "sqluint32"
    P1003768.sqc:140: warning: no semicolon at end of struct or union
    P1003768.sqc:140: error: syntax error before '}' token
    P1003768.sqc:141: error: syntax error before "sqluint32"
    P1003768.sqc:141: warning: no semicolon at end of struct or union
    P1003768.sqc:141: error: conflicting types for `data'
    P1003768.sqc:140: error: previous declaration of `data'
    P1003768.sqc:141: warning: data definition has no type or storage class
    P1003768.sqc:141: error: syntax error before '}' token
    P1003768.sqc:149: warning: data definition has no type or storage class
    P1003768.sqc:163: error: syntax error before "sqlint32"
    P1003768.sqc:163: warning: no semicolon at end of struct or union
    P1003768.sqc:172: error: syntax error before "TESTPROCEDURE_SQLCODE_2"
    P1003768.sqc:172: warning: data definition has no type or storage class
    P1003768.sqc:174: error: syntax error before '}' token
    P1003768.sqc:175: warning: data definition has no type or storage class
    P1003768.sqc:184: error: field `CA' has incomplete type
    P1003768.sqc:185: error: field `vars' has incomplete type
    P1003768.sqc:187: confused by earlier errors, bailing out
    gcc: P1003768.o: No such file or directory
    dllwrap: gcc exited with status 1

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


    call TestProcedure
    SQL0440N No authorized routine named "TESTPROCEDURE" of type "PROCEDURE" having compatible arguments was found. SQLSTATE=42884

    select text from result

    TEXT

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


    0 record(s) selected.


    terminate
    DB20000I The TERMINATE command completed successfully.


    C:\>db2set
    DB2_SQLROUTINE_COMPILE_COMMAND=c:\Cygwin\db2gcc.ba t SQLROUTINE_FILENAME
    DB2_ENABLE_LDAP=YES
    DB2INSTPROF=F:\Program Files\IBM\SQLLIB
    DB2COMM=TCPIP

    C:\>db2 -td! -v -fsample.clp
    connect to ic2 user s6admin USING

    Database Connection Information

    Database server = DB2/NT 8.1.0
    SQL authorization ID = S6ADMIN
    Local database alias = IC2


    drop table result
    DB20000I The SQL command completed successfully.

    create table result (text VARCHAR(80))
    DB20000I The SQL command completed successfully.

    drop procedure TestProcedure
    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
    SQL0204N "S6ADMIN.TESTPROCEDURE" is an undefined name. SQLSTATE=42704

    create procedure TestProcedure ()
    BEGIN
    insert
    into result (text)
    values ('If you can read this, it worked.');
    END
    DB20000I The SQL command completed successfully.

    call TestProcedure

    Return Status = 0


    select text from result

    TEXT

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

    If you can read this, it worked.


    1 record(s) selected.


    terminate
    DB20000I The TERMINATE command completed successfully.


    Thanks in advance!

  10. #10
    Join Date
    Jul 2004
    Posts
    53
    You know what? Never you mind!

    After so much posting trouble and reading my own posts (LOL), I saw I didn't save the batch file after making the change in the batch and DB2PATH was still f:\program files\ibm\sqllib. I changed it to f:\progra~1\ibm\sqllib, reran and worked like a charm.

    Can I integrate this with the DB2 Developer Center?

  11. #11
    Join Date
    Jul 2004
    Posts
    53
    Quote Originally Posted by Razor1973
    You know what? Never you mind!

    After so much posting trouble and reading my own posts (LOL), I saw I didn't save the batch file after making the change in the batch and DB2PATH was still f:\program files\ibm\sqllib. I changed it to f:\progra~1\ibm\sqllib, reran and worked like a charm.

    Can I integrate this with the DB2 Developer Center?
    Yes, I can. I just did!

    Thanks so much, Andy!!!

Posting Permissions

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