Solved

DB2 8.1.5 SP COMPILE PROBLEM

Posted on 2004-08-17
3
682 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now