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.
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.
Comment