• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

DB2 8.1.5 SP COMPILE PROBLEM

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
k_murli_krishna
Asked:
k_murli_krishna
  • 2
1 Solution
 
ghp7000Commented:
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
 
k_murli_krishnaAuthor Commented:
Sorry for the delay.
0
 
ghp7000Commented:
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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now