Thread: stored procedure in DB2 5.3
04-12-13, 09:58 #1Registered User
- Join Date
- Apr 2013
Unanswered: stored procedure in DB2 5.3
i have a job to do and to be honest I don't know much about stored procedures in DB2. It's my first time writing SP and I have a problem that for You could be funny.
I searched google and found nothing about it. And becouse I'm not going to write any more SP I don't want to buy a book and learn it.
Please help me or just give an example how to solve a problem.
My program needs to call a stored procedure that will insert a row into table and then update another table.
it looks like this:
CREATE PROCEDURE lib1.INSERTPILNE ( IN SALESORDER DECIMAL(7, 0)) SPECIFIC lib1.INSERTPILNE LANGUAGE SQL UPDATE lib2.SRBSOH SET OHSTXC = '' WHERE OHORNO = SALESORDER; insert into qgpl.pilne values (SALESORDER, 'CNP', '');
insert into qgpl.pilne values (SALESORDER, 'CNP', '') [SQL0206] Column SALESORDER not in specified tables.
I tried to create two procedures and call first in the second and still nothing.
I also tried: add "begin" and "end".
I saw some examples but none of them wants to work in my DB2
To insert procedure to the database I use IBM data studio.
04-12-13, 12:09 #2Registered User
- Join Date
- May 2003
Are you using DB2 for iSeries? Please state the details of your environment.M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390