By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,997 Members | 1,470 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,997 IT Pros & Developers. It's quick & easy.

problems creating a simple stored procedure in DB2

P: n/a
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)
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Seems like the C-compiler can't find the include files for DB2.
Check if:
sqllib/include
is listed in the appropriate environment variables (INCLUDE (?))

Cheers
Serhe

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #2

P: n/a
Thanks for your reply. What environment variables do I need to set
and what do I need to set them to for the C compiler to find the
appropriate libraries?

Serge Rielau <sr*****@ca.eye-bee-m.com> wrote in message news:<bs**********@hanover.torolab.ibm.com>...
Seems like the C-compiler can't find the include files for DB2.
Check if:
sqllib/include
is listed in the appropriate environment variables (INCLUDE (?))

Cheers
Serhe

Nov 12 '05 #3

P: n/a
Depends on your platform I suppose.
Have you checked the application development guide?
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #4

P: n/a
I found the problem. The only file that was in my sqllib/include was
asn.h. I found another installation that had .h and .f files in
sqllib/include. Copying over those files solved the problem. I must
have missed some installation step.
Nov 12 '05 #5

P: n/a
May be, you did not have your application development client installed

Cheers
Sathyaram
www.db2click.com

li********@hotmail.com (Lili) wrote in message news:<76**************************@posting.google. com>...
I found the problem. The only file that was in my sqllib/include was
asn.h. I found another installation that had .h and .f files in
sqllib/include. Copying over those files solved the problem. I must
have missed some installation step.

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.