473,287 Members | 1,419 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,287 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 6025
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.