If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Compiling Stored Procedures on Solaris using gcc

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-20-05, 07:51
ggnanaraj ggnanaraj is offline
Registered User
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 171
Compiling Stored Procedures on Solaris using gcc

DB2 UDB 7.2
Solaris Sparc 8
gcc

Has any one been able to compile a stored procedure using gcc on Solaris Sparc 8 - DB2 UDB 7.2?

db2 -td@ -vf <procname>

Registry variables have to be modified. I tried using what gcc uses on Linux. But it fails.

TIA.
Reply With Quote
  #2 (permalink)  
Old 11-20-05, 12:26
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
gcc

why not indicating the error immediatly ?
how can we guess what is going wrong ?
using gcc is possible..
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #3 (permalink)  
Old 11-20-05, 20:39
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
CHANGED THE DB2_SQLROUTINE_COMPILE_COMMAND AS
FOLLOWING:
DB2SET DB2_SQLROUTINE_COMPILE_COMMAND="GCC -FPIC -D_REENTRANT -I/HOME/TS5INST/SQLLIB/INCLUDE SQLROUTINE_FILENAME.C -SHARED -LPTHREAD -O SQLROUTINE_FILENAME -R/HOME/TS5INST/SQLLIB/LIB -R/USR/LOCAL/LIB -L/HOME/TS5INST/SQLLIB/LIB -L/USR/LOCAL/LIB -LDB2" AND THEN RECYCLE DB2, THEN RECREATE SQL PROCEDURE.

hope it work.
please give error message next time

Last edited by wangzhonnew; 11-20-05 at 20:41.
Reply With Quote
  #4 (permalink)  
Old 11-23-05, 03:18
ggnanaraj ggnanaraj is offline
Registered User
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 171
Quote:
Originally Posted by wangzhonnew
CHANGED THE DB2_SQLROUTINE_COMPILE_COMMAND AS
FOLLOWING:
DB2SET DB2_SQLROUTINE_COMPILE_COMMAND="GCC -FPIC -D_REENTRANT -I/HOME/TS5INST/SQLLIB/INCLUDE SQLROUTINE_FILENAME.C -SHARED -LPTHREAD -O SQLROUTINE_FILENAME -R/HOME/TS5INST/SQLLIB/LIB -R/USR/LOCAL/LIB -L/HOME/TS5INST/SQLLIB/LIB -L/USR/LOCAL/LIB -LDB2" AND THEN RECYCLE DB2, THEN RECREATE SQL PROCEDURE.

hope it work.
please give error message next time
Thanks a ton! It works with the following case changes...
Code:
db2set DB2_SQLROUTINE_COMPILE_COMMAND="gcc -fpic -D_REENTRANT -I/export/home/db2inst1/sqllib/include SQLROUTINE_FILENAME.c -shared -lpthread -o SQLROUTINE_FILENAME -R/export/home/db2inst1/sqllib/lib -R/usr/local/lib -L/export/home/db2inst1/sqllib/lib -L/usr/local/lib -ldb2"
GET ROUTINE also works. However, PUT ROUTINE fails with the following error:

PHP Code:
db2 "put routine from UPDATE_SALARY_1.sar"
SQL0443N  Routine "PUT_ROUTINE_SAR" (specific name
"db2udp!put_routine_sar_1parm"has returned an error SQLSTATE with diagnostic
text 
"-14847,      , failed ...".  SQLSTATE=38000

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On