×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.





Dear All,



Thank you very much Tom and thanks to All whom have replied. I have learned a lot from the midrange list.

I have not tried every thing yet...but I am just summerizing all the findings in one place.



The Stored procedure code can be saved in a member of type SQL and can be executed from DB2-SQL environment using the Call command.

Stored procedure can be also called from a HLL as RPG and from CLP as well.



Calling the stored procedure from RPG:
-------------------------------------
If you are expecting one row back use the following:

C/EXEC SQL
C+ Call procedure(:Parm1, Parm2,……Parm5)
C/END-EXEC
If you have multiple rows returned you have to declare a SQLDA.
C/EXEC SQL
C+ INCLUDE SQLDA
c/END-SQL
Then call the procedure
C/EXEC SQL
C+ CALL procedure
C+ using DESCRIPTOR :PARMS
C.END-EXEC


Calling the stored procedure from CLP:
-------------------------------------------

Use CALL PGM(QZDFMDB2) PARM(&CMD)

Where &CMD is the call procedure string.

Or simply use RUNSQLSTM to call a SQL script that is calling the procedure.



Thanks and best regards



All the best to you



Dina



From: thomas.l.deskevich@xxxxxxxxxxxxx
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Stored procedure question
Date: Mon, 8 Mar 2010 08:16:52 -0500

Funny, I was just looking at this redbook over the weekend. I live on the
EDGE!
http://www.redbooks.ibm.com/redbooks/pdfs/sg246503.pdf

Page 98

Hope this helps.

Tom Deskevich



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.