473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

problems creating a simple stored procedure in DB2

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
5 6026
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
3
by: Henry Reardon | last post by:
I installed DB2 for Linux, Unix, and Windows on V8.2 (i.e. 8.1.7) on Windows XP on Friday. I had some problems with migration which are still outstanding - see my earlier thread - but I managed to...
0
by: billmiami2 | last post by:
Perhaps many of you MS Access fanatics already know this, but it seems that stored procedures and views are possible in Jet. I thought I would leave this message just in case it would help anyone....
6
by: Not Me | last post by:
Hi, I have a stored procedure as a recordsource for a form, taking a parameter from another form, it displays records that are already present without any problems. I had to add a resync...
12
by: Lucky | last post by:
Hi guys! i want to create one cursor in the t-sql. the problem is i want to use stored procedure instead of select command in cursor. can anyone tell me how can i use stored procedure's o/p to...
9
by: Frank | last post by:
Hi, imagine there's a WEB application reading data from an Oracle database to visualize in using DataGrids in the clients browser. Yes, sounds simple, just create OracleConnection + OracleCommand...
1
by: Ir0neagle | last post by:
I am generating upgrade/new install scripts for my project. I am able to do this in oracle and sql server but an running into problems in db2. What I am trying to do is to use some logic to only...
2
by: =?Utf-8?B?SXbDoW4gU2Fpbno=?= | last post by:
I ran the aspnet_regsql.exe tool with the -sqlexportonly option to create the script. I searched and replace the string by and had the dba's run the script. When I do anything like...
2
by: Andrew Cooper | last post by:
Greetings, I'm creating a website using ASP.NET. In creating my DAL I've got a Table Adapter that I've set up to use an existing Stored Procedure from an SQL Server 2000 database. However,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.