Hi,
Thanks for the suggestions. However, I followed your instructions and the stored procedure compilation still fails with the following errors:
DB2ADMIN.AUDIT_EVENT_REMOV
DB2ADMIN.AUDIT_EVENT_REMOV
D:\SQLLIB\function\routine
LINE MESSAGES FOR P3304730.sqc
------ --------------------------
SQL0060W The "C" precompiler is in progress.
SQL0091W Precompilation or binding was ended with "0" errors and "0" warnings.
*** COMPILE D:\SQLLIB\function\routine
***DB2_SQLROUTINE_COMPILER
@echo onset SQLROUTINE_FILENAME=P33047
set db2path=D:\SQLLIBnmake /f D:\SQLLIB\function\routine
*** D:\SQLLIB\function\routine
***LIBRARY P3304730EXPORTS _pgsjmp@12pgsjmp=_pgsjmp@1
'nmake' is not recognized as an internal or external command,operable program or batch file.
--------------------------
SQL7032N SQL procedure "" not created. Diagnostic file is "". SQLSTATE=00000
DB2ADMIN.AUDIT_EVENT_REMOV
DB2ADMIN.AUDIT_EVENT_REMOV
**************************
Note: I had modified the sr_cpath.bat by removing all REM commands for the MS C++ compiler (see below). I then added this file to the DB2_SQLROUTINE_COMPILER_PA
**************************
@echo off
set VCV6_DRIVE=C:\Program Files\Microsoft Visual Studio
set include=%include%;%VCV6_DR
set lib=%lib%;%VCV6_DRIVE%\VC9
set path=%path%;%VCV6_DRIVE%\C
@echo off
REM set VCV5_DRIVE=c:\Program Files\devstudio
REM set include=%include%;%VCV5_DR
REM set lib=%lib%;%VCV5_DRIVE%\vc\
REM set path=%path%;%VCV5_DRIVE%\s
**************************
My sqlproc.mak file
**************************
# Note: The default compiler options are set for the Microsoft Visual C++
# compiler. If you use the IBM VisualAge C++ compiler, remove the
# "COMPILER=MS" below and uncomment "COMPILER=IBM" that follows.
COMPILER=MS
#COMPILER=IBM
# Note: The default is to build with no DEBUG options. If you want to
# build with DEBUG options, remove "DEBUG=NO" below and uncomment
# "DEBUG=YES" that follows.
DEBUG=NO
#DEBUG=YES
CFLAGSDEB=
LINKFLAGSDEB=
!IF "$(COMPILER)" == "MS"
# Microsoft Visual C++ compiler
CC=cl
!IF "$(DEBUG)" == "YES"
CFLAGSDEB=-Z7
LINKFLAGSDEB=-debug:full -pdb:none -debugtype:cv
!ENDIF
CFLAGS=-Ox -W2 -TC -D_X86_=1 -DPSMDBG $(CFLAGSDEB) -I"$(DB2PATH)\include"
LINKFLAGS=/link -dll $(LINKFLAGSDEB) /out:$(SQLROUTINE_FILENAME
!ENDIF
!IF "$(COMPILER)" == "IBM"
# IBM VisualAge C++ compiler
CC=icc
!IF "$(DEBUG)" == "YES"
CFLAGSDEB=-Ti
LINKFLAGSDEB=/DEBUG
!ENDIF
CFLAGS=-Ge- -Gm+ -W0 -DPSMDBG $(CFLAGSDEB) -I"$(DB2PATH)\include"
LINKFLAGS=/B"/ST:96000 /PM:VIO /DLL $(LINKFLAGSDEB)"
!ENDIF
LIBS="$(DB2PATH)\lib\db2ap
{$(SQLROUTINE_FILENAME)}.d
!IF "$(COMPILER)" == "MS"
$(CC) $(CFLAGS) $(SQLROUTINE_FILENAME).c $(LINKFLAGS) -def:$(SQLROUTINE_FILENAME
!ELSE
ilib /GI $(SQLROUTINE_FILENAME).def
$(CC) $(CFLAGS) $(SQLROUTINE_FILENAME).c $(LINKFLAGS) $(SQLROUTINE_FILENAME).exp
!ENDIF
**************************
The stored procedure that I'm trying to build/compile using DB2 Stored Procedure Builder
**************************
CREATE PROCEDURE audit_event_remove_sp(IN v_cutofftime TIMESTAMP)
RESULT SET 0
SPECIFIC AUEVREM
LANGUAGE SQL
--************************
-- Inserted
-- May 2003
-- remove - called in EventDB
--************************
L_audit_event_re:
BEGIN NOT ATOMIC
DELETE FROM EVENT_AUDIT_TBL
WHERE CREATIONTIME < v_cutofftime;
--
END L_audit_event_re
**************************
ANY suggestions would be greatly appreciated! THANKS!
**************************
Main Topics
Browse All Topics





by: ghp7000Posted on 2003-06-02 at 13:35:37ID: 8632601
This error is due to the fact that the default compiler, which is the Microsoft compiler is being used and you don't have the MS compiler installed, you most likely have the IBM compiler. In any case, the compiler choice is set by commenting/uncommenting the file sqllib\function\routine\sq lproc.mak.
Here is how to do it: (V7.2)
locate the file on your drive;
close down SPB;
terminate all active connections to your test database;
for your test database, do db2stop
open the sqlproc.mak file and follow the instructions that are in the file;
re save the file, check the OS to make sure that the file time has indeed changed;
re open the file and confirm that the selection you made is active; if the change has not been made, set the file's attribute to A and re save the file;
re start the instance->db2start;
re open SPB and re build the procedure, it should build OK now;
once the stored procedure has been built and tested, use the DB2 get routine command to generate the sar file, then use the put routine command to distribute it.