473,569 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Errors in first stored procedure

Hello,

I created the following stored procedure. (Please ignore the logic in
it; at this point it is not complete and I am trying to get the basic
structure working first.)

CREATE PROCEDURE upgrade_sal ()
LANGUAGE SQL
BEGIN
DECLARE eldest INT;
DECLARE nextemp INT;
DECLARE newsalary INT;
DECLARE newbonus INT;
DECLARE c1 CURSOR WITH HOLD FOR
SELECT empno FROM employees FOR UPDATE OF salary, bonus;

SELECT MAX(age) INTO eldest FROM employees WHERE status = 1 ;
IF (eldest = 0) THEN GOTO NO_MORE; END IF;

OPEN c1;

FETCH c1 INTO nextemp;

LOOP
SET newsalary = 1000;
SET newbonus = newsalary * 10 / 100;
UPDATE employees SET salary = newsalary, bonus = newbonus
WHERE CURRENT OF c1;
FETCH c1 INTO nextemp;
END ;

NO_MORE:
CLOSE c1;
END
Now, when I try to compile this, DB2 complains with the following
error.

SQL7032N SQL procedure "UPGRADE_SA L" not created. Diagnostic file is
"P5350392.l og". SQLSTATE=42904

I tried to locate the diagnostic file mentioned in the error message
but can't find it. Any help will be greatly appreciated.
Nov 12 '05 #1
1 3665
Hello,

You can find these files under :

UNIX
$HOME/sqllib/function/routine/sqlproc/<db_name>/<schema_name>/tmp

Windows
sqllib\function \routine\sqlpro c\<db_name>\<sc hema_name>\tmp

AND here is the explanation for SQL7032N error :
=============== =============== =============== ==

SQL7032N SQL procedure procedure-name not created. Diagnostic file is
file-name.

Explanation: SQL Procedure procedure-name was not created. One of the
following has occurred:

Support for SQL stored procedures is not installed and configured on
this server. You need to have the DB2 Application Development Client
and a C compiler installed on the server to create SQL procedures. You
may need to set the DB2 registry variable DB2_SQLROUTINE_ COMPILER_PATH
to point to a script or batch file that contains environment settings
for the C compiler on your platform.
DB2 failed to precompile or compile the SQL stored procedure. DB2
creates an SQL procedure as a C program that contains embedded SQL.
Errors not found during the initial parsing of the CREATE PROCEDURE
statement can be found during the precompile or compile stage.
For UNIX platforms, the full path of the file that contains diagnostic
information is:
$DB2PATH/function/routine/sqlproc/ \
$DATABASE/$SCHEMA/tmp/file-name

where $DATABASE represents the name of the database, and $SCHEMA
represents the schema name of the SQL procedure.

For OS/2 and Windows operating systems, the full path of the file that
contains diagnostic information is:
%DB2PATH%\funct ion\routine\sql proc\ \
%DATABASE%\%SCH EMA%\tmp\file-name

where %DATABASE% represents the name of the database, and %SCHEMA%
represents the schema name of the SQL procedure.

User Response: Ensure that both a compatible C compiler and a DB2
Application Development Client are installed on the server. If a
precompile or compile error occurred, refer to the messages from the
precompiler or compiler in the diagnostic file file-name.

Ensure that the DB2 registry variable DB2_SQLROUTINE_ COMPILER_PATH is
set to point to a script or batch file that sets up the C compiler
environment. On a UNIX operating system, for example, you may create a
script called "sr_cpath" in the
/home/DB2INSTANCE/sqllib/function/routine directory. To set the DB2
registry variable DB2_SQL_ROUTINE _COMPILER_PATH accordingly, issue the
following command:

db2set DB2_SQLROUTINE_ COMPILER_PATH = \
" \
/home/DB2INSTANCE/sqllib/function/ \
routine/sr_cpath"

sqlcode: -7032

sqlstate: 42904
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7742
by: Brian | last post by:
Hi there, I am converting a large PL/SQL project into Transact-SQL and have hit an issue as follows: I have a PL/SQL procedure that converts a string to a date. The procedure does not know the format of the date in the string so it tries loads of formats in converting the string to a date until it succeeds.
3
4010
by: aaj | last post by:
SQL SERVER 2000 Hi all This is my first attempt at writing a stored procedure. I have managed to get it working but its unlikely to be the best way of handling the problem. While writing it I found some things that I don't understand so if any one could shed any light it would be much appreciated. I have posted these at the end.
4
379
by: Phil Townsend | last post by:
While we have switched to the Application.Data block to improve connection management, we are still experiencing connection pool errors on occasions. I have been careful to explicitly close connections. Furthermore, for added insurance, I am calling close() and dispose() on the connection object that is passed to the SqlHelper method. Still I...
4
1686
by: William F. Robertson, Jr. | last post by:
One of my developers came to me with this question and I don't have an answer for them. The only suggestion I had for them was to change the return to a output parameter and put a try catch around it and look for the output parameter to have a value. I would have thought this should have been posted in the sql newgroups, but I know exactly...
3
1685
by: Jim in Arizona | last post by:
I'm going insane! I don't know if it's just that the .net 2.0 framework is buggy or if it really is my code. This is pretty hard to explain since I can't even begin to nail down why this is happening. I have two text boxes. One is for the ID number, which when postback occurs, inserts into the related table as the foreign key. The other...
2
1955
by: Ford Desperado | last post by:
In my stored procedure I'm calling a buggy and flaky stored procedure that comes from a third party. When I run my stored proceure from QA, I'm getting a whole buch of errors raised inside the third party one. Is there any way I could just ignore them, so that if I run my SP from QA, only errors from my code, if any, show up? TIA
6
2347
by: SandySears | last post by:
I am trying to use a stored procedure to insert a record using VS 2005, VB and SQL Server Express. The code runs without errors or exceptions, and returns the new identifer in the output parameters. It returns my error text message in another output parameter as "ok", which is the value that is set in the stored procedure prior to doing the...
1
2431
by: sshankar | last post by:
Hi, New to Stored procedure. Basically just installed DB2 v8.1.0.36 Was trying to build a stored procedure.. It is giving following error.. Looks like some error related to configuration files... Can you help I tried to have a look at all the files .. however unable to solve it .. can anyone let me know what i'm missing.. This is...
0
1818
by: mersis | last post by:
I have a very very annoying problem. I want to create a stored procedure, that creates a table and does various things with it. Before creating a stored procedure I check if the table is there. If it is, I first drop it, and then recreate it. However when I try to create such stored procedure DB2 complains if the table already exists. The stupid...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.