Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error while building a stored procedure

Status
Not open for further replies.

PawelTru

Programmer
Jul 18, 2002
24
0
0
US
Hello

I am trying to create a test stored procedure. I know the syntax of the sp is correct but when I try to build I get the following log and it says that the sp build failed.



BUSDAT.ADMINISTRATOR.PROCEDURE1 - Build started.
Create stored procedure returns -7032.

-- LOG FILE P4373962.log FOR PROCEDURE ADMINISTRATOR.PROCEDURE1

-- DB2_SQLROUTINE_PREPOPTS=

-- PREP/BIND MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp\P4373962.sqc


LINE MESSAGES FOR P4373962.sqc

------ --------------------------------------------------------------------

SQL0060W The "C" precompiler is in progress.

SQL0091W Precompilation or binding was ended with "0"

errors and "0" warnings.


-- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sr_cpath.bat




-- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp\P4373962.BAT

@echo on
set SQLROUTINE_FILENAME=P4373962
set db2path=C:\PROGRA~1\IBM\SQLLIB

-- COMPILATION COMMAND:

nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.mak


-- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp\P4373962.def

LIBRARY P4373962
EXPORTS _pgsjmp@8
pgsjmp=_pgsjmp@8


-- COMPILATION MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp\P4373962.c
-- C COMPILATION ERROR CODES: 0 0 1


C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp>set SQLROUTINE_FILENAME=P4373962



C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp>set db2path=C:\PROGRA~1\IBM\SQLLIB



C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\BUSDAT\ADMINISTRATOR\tmp>nmake /f C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc.mak

'nmake' is not recognized as an internal or external command,

operable program or batch file.


-- END OF LOG FILE (SQLCODE: -7032)

ADMINISTRATOR.PROCEDURE1 - Build failed.
ADMINISTRATOR.PROCEDURE1 - Roll back completed successfully.


Please Help

Thanks
 
if you are using the Microsoft Visual C++.NET compiler, open the DB2 Command Line Processor and issue:

db2set DB2_SQLROUTINE_COMPILER_PATH="c:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\vsvars32.bat"

db2stop
db2start

The Stored Procedure builder requires a C compiler, when trying to build a stored procedure. It you are using a different C compiler, we will have to modify the db2set command.
 
When I issue the statment I get the following:
The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL1024N A database connection does not exist. SQLSTATE=08003

I opened a connection by typing connect to DBNAME USER ...

then when I try to execute the same command I get:
The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token &quot;DB2_SQLROUTINE_COMPILER_PATH&quot; was found following &quot;db2set &quot;. Expected tokens may include: &quot;JOIN <joined)table>&quot;. SQLSTATE=42601

I am running DB2 v 8.1
Also I have VS6.0 as well as .NET 2003 installed on my workstation. (no compilers on server)

Thanks
 
Open the command line processor by openning a MS-DOS prompt window and enter the command &quot;db2cmd&quot;. In the upper left hand corner you should see &quot;DB2 CLP&quot;.
Enter the command:
db2set DB2_SQLROUTINE_COMPILER_PATH=&quot;c:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\vsvars32.bat&quot;
I think what you have done was to issue command:
db2 set (There should be no blank between the db2 and set).

After issuing the above command, reset the environment by issuing:
db2stop force
db2start

In order to create a stored procedure with the DB2 Development Center on DB2 UDB Version 8.1 you will need to install the Microsoft Visual C++.NET compiler on the server, where the DB2 Stored Procedure (External Routine) is being built. This is required when building SQL/PL (Procedure Language) stored procedures.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top