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 > Unable to compile Sql stored procedures in DB2 with GCC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-02-07, 17:13
rjotwani rjotwani is offline
Registered User
 
Join Date: Sep 2007
Posts: 4
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
Reply With Quote
  #2 (permalink)  
Old 10-04-07, 07:02
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #3 (permalink)  
Old 10-04-07, 14:44
rjotwani rjotwani is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 10-05-07, 02:14
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #5 (permalink)  
Old 10-05-07, 12:14
rjotwani rjotwani is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 10-08-07, 09:56
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
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