Solved

DB2 8.1.5 SP COMPILE PROBLEM

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RPG to c# 3 399
proc contents in SAS EG with connection to UNIX Db2 Tables 1 129
finding tables 2 61
How to check if Database softwares installed on Windows Server 3 53
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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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