Solved

DB2 8.1.5 SP COMPILE PROBLEM

Posted on 2004-08-17
3
708 Views
Last Modified: 2008-02-01
1) We are having DB2 8.1.0 eval ESE edition installed on windows 2000 server. We applied fixpack 5 to make it 8.1.5.

2) To make Stored Proc's to compile we installed Microsoft Visual Studio VC++ 6.0.

3) Now we put sr_cpath.bat in ROUTINE folder with contents pointing to bin, include & lib dir's of VC98.

4) Now we set the following registry variables via SET command & reboot:

DB2_SQLROUTINE_COMPILER_PATH=C:\Program Files\IBM\SQLLIB\FUNCTION\ROUTINE\sr_cpath.bat
OR
DB2_SQLROUTINE_COMPILER_PATH="c:\Micros~1\vc98\bin\vcvars32.bat"

AND

DB2_SQLROUTINE_COMPILE_COMMAND="cl -Od -W2 /TC -D_X86_=1 -I%DB2PATH%\include SQLROUTINE_FILENAME.c /link -dll -def:SQLROUTINE_FILENAME.def/out:SQLROUTINE_FILENAME.dll %DB2PATH%\lib\db2api.lib"

The following error is returned:

C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\ECCCLOS\ECCCL\tmp>"cl -Od -W2 /TC -D_X86_=1 -IC:\PROGRA~1\IBM\SQLLIB\include P0003065.c /link -dll -def:P0003065.def/out:P0003065.dll C:\PROGRA~1\IBM\SQLLIB\lib\db2api.lib"
The filename, directory name, or volume label syntax is incorrect.

Is this because we made a mistake in copying multiline text in PDF to single line in textpad since that is what is required OR THERE IS SOME OTHER VALID REASON.
0
Comment
Question by:k_murli_krishna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
ghp7000 earned 100 total points
ID: 11825155
the correct way is:
DB2 SET DB2_SQLROUTINE_COMPILER_PATH="C:\Program Files\Microsoft Visual Studio\VC98\bin\vcvars32.bat"

if you want to set the compile command (optional, not necessary)

DB2 SET DB2_SQLROUTINE_COMPILE_COMMAND="cl -Ox -W2 -TC -D_X86=1 -MD -I%DB2PATH%\include (space)
SQLROUTINE_FILENAME.c /link -dll -def:SQLROUTINE_FILENAME.def /out:SQLROUTINE_FILENAME.dll (space)
%DB2PATH%\lib\db2api.lib"

(space) means 1 whitespace character

You do not need to reboot the machine.
Never use textpad with 8.1, textpad has a bug in it in which it sends hidden characters to db2 which db2 cannot process
0
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 11915687
Sorry for the delay.
0
 
LVL 13

Expert Comment

by:ghp7000
ID: 11926498
just to follow up on this question a little bit more, because in v8 there are a lot of bugs associated with the microsoft compiler, that is why in version 8.2 the ms compiler on server won't be a requirement for stored procedures.
Note that the DB2_SQLROUTINE_COMPILER_PATH is different for compiler on v6 than v7, the one I gave you in the accepted answer is for version 6 of the compiler, if you change the compiler to v7 you will need to update the  DB2_SQLROUTINE_COMPILER_PATH variable.
If you do set the DB2_SQLROUTINE_COMPILE_COMMAND variable, make sure the DB2PATH variable is using the dos naming convention and not the windows naming convention. If you don't set DB2PATH to dos naming convention, you will get the error "The filename, directory name, or volume label syntax is incorrect." because


-I%DB2PATH% in DB2_SQLROUTINE_COMPILE_COMMAND cannot copy 'Program Files' from DB2PATH because:
Program Files has a space in it.
Hope this isnt too confusing for you.
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question