Unanswered: UDB 7.2 - stored procedures / C compiler
I recently posted a query regarding problems that I was having when trying to run a stored procedure on DB2 UDB 7.2. A number of you kindly informed me that I need to have a C compiler installed on the server before SQL procedures will run on UDB 7.2.
The client for whom I am writing the query has questioned why they need a compiler on their server, particularly on the live server (there is a development server, a test server, and a live server here).
I now have two further questions:
1) Can I develop SQL procedures with a C compiler installed on my client rather than the server? (I suspect not since stored procedures run server-side, but it is worth asking the question)
2) If a C compiler were installed on the development server, would it be possible to develop the stored procedures on the development server then transfer them - already compiled - onto the live server (in other words, have a C compiler on the development server but not on the live server)?
Sorry for the fragmented replys, something went haywire while I was
trying to write my whole reply. I will answer the whole thing again here,
and maybe the moderator can delete those other replys.
For question (1) only if you have a DB2 database installed on the client. SPs are server-side processes and are compiled to the OS that
DB2 runs on top of. For this reason, you can only "Deploy" SPs from
databases that run on the same OS (Win -> Win, Linux -> Linux, etc).
For Question (2):
According to IBM yes you can. They call it "Deploying" SPs. They
supply two SPs / CLP commands: GET ROUTINE and PUT ROUTINE.
See the manuals for proper syntax & usage.
I was unsuccessful getting these to work on DB2 7.2 PE on windows.
I could not get the GET ROUTINE to run error free. I want to try it on 8.1, but have not had the time and that project is low priority right now.
Our servers run under Linux which basically have the C compiler built in, so we really do not need to "Deploy" the SP, just build them on each server. I was however able to get the GET ROUTINE to work here just to see if there was a problem with the actual routine.