I'm having problems creating a simple stored procedure in DB2. Can
someone help? Here is the screen dump when I tried to load the stored
procedure. Thanks for any help.
Create procedure update_salary (in emp_number char(6), in rate
integer)
language sql
begin
update employee
set salary = salary * (1.0 + rate / 100.0)
where empno = emp_number;
end
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL7032N SQL procedure "UPDATE_SALARY" not created. Diagnostic file
is
"P7593115.log". SQLSTATE=42904
-- LOG FILE P7593115.log FOR PROCEDURE DB2INST1.UPDATE_SALARY
-- DB2_SQLROUTINE_PREPOPTS=
-- PREP/BIND MESSAGES FOR
/private/db2inst1/sqllib/function/routine/sqlproc/SAMPLE/DB2INST1/tmp/P7593115.sqc
LINE MESSAGES FOR P7593115.sqc
------ --------------------------------------------------------------------
SQL0060W The "C" precompiler is in progress.
SQL0091W Precompilation or binding was ended with "0"
errors and "0" warnings.
-- CONTENTS OF /private/db2inst1/sqllib/function/routine/sr_cpath
#!/bin/sh
PATH=$PATH:/opt/SUNWspro/bin
export PATH
-- CONTENTS OF /private/db2inst1/sqllib/function/routine/sqlproc/SAMPLE/DB2INST1/tmp/P7593115.sh
SQLROUTINE_FILENAME=P7593115
export SQLROUTINE_FILENAME
-- COMPILATION COMMAND:
CC -xarch=v8plusa -mt -KPIC -I/private/db2inst1/sqllib/include
P7593115.c -G -o P7593115 -L/private/db2inst1/sqllib/lib
-R/private/db2inst1/sqllib/lib -ldb2
-- CONTENTS OF /private/db2inst1/sqllib/function/routine/sqlproc/SAMPLE/DB2INST1/tmp/P7593115.exp
pgsjmp
-- COMPILATION MESSAGES FOR
/private/db2inst1/sqllib/function/routine/sqlproc/SAMPLE/DB2INST1/tmp/P7593115.c
"P7593115.c", line 14: Error: Could not open include file "sqladef.h".
"P7593115.c", line 16: Error: The type "sqla_runtime_info" is
incomplete.
"P7593115.sqc", line 10: Error: Could not open include file
<sqlenv.h>.
"P7593115.sqc", line 11: Error: Could not open include file <sql.h>.
"P7593115.sqc", line 12: Error: Could not open include file <sqlda.h>.
"P7593115.sqc", line 13: Error: Could not open include file
<db2psmd.h>.
"P7593115.sqc", line 60: Error: The type "const sqlca" is incomplete.
"P7593115.sqc", line 142: Error: Type name expected instead of
"sqluint32".
"P7593115.sqc", line 143: Error: Type name expected instead of
"sqluint32".
"P7593115.sqc", line 143: Error: Type name expected instead of
"sqldbchar".
"P7593115.sqc", line 165: Error: Type name expected instead of
"sqlint32".
"P7593115.sqc", line 174: Error: Type name expected instead of
"sqlint32".
"P7593115.sqc", line 182: Error: Type name expected instead of
"sqlint32".
"P7593115.sqc", line 194: Error: The type "sqlca" is incomplete.
"P7593115.sqc", line 199: Error: sqlint32 is not defined.
"P7593115.sqc", line 202: Error: sqlint32 is not defined.
"P7593115.sqc", line 207: Error: sqlint32 is not defined.
"P7593115.sqc", line 209: Error: sqluint32 is not defined.
"P7593115.sqc", line 211: Error: sqlint32 is not defined.
"P7593115.sqc", line 214: Error: sqlint32 is not defined.
"P7593115.sqc", line 273: Error: The type "sqlca" is incomplete.
"P7593115.sqc", line 278: Error: The type "sqlca" is incomplete.
"P7593115.sqc", line 278: Error: Unexpected type name "_psm_SQLCA"
encountered.
"P7593115.sqc", line 278: Error: sqlcode is not defined.
"P7593115.sqc", line 278: Error: The type "sqlca" is incomplete.
Compilation aborted, too many Error messages.
-- END OF LOG FILE (SQLCODE: -7032)