467,882 Members | 1,203 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,882 developers. It's quick & easy.

Proc1 result set with proc2

Hello

DB2/NT 8.1.6
Stored procedure Proc1 (SQL) return result set.
How can I call Proc1 in Proc2(SQL) and scroll on Proc1 result set? "DECLARE
CURSOR FOR CALL..." don't work. Any other statement?

DROP TABLE t1 @
CREATE TABLE t1(c1 integer, c2 varchar(10)) @
INSERT INTO t1 VALUES (1, 'aaa') @
INSERT INTO t1 VALUES (2, 'bbb') @

DROP PROCEDURE p1@
CREATE PROCEDURE p1()
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE cur1 CURSOR WITH RETURN TO CALLER FOR
SELECT c1, c2 FROM t1;

OPEN cur1;
END@

DROP PROCEDURE p2@
CREATE PROCEDURE p2
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
-- CALL p1; ????
-- I need open P1, do something with each row and close cursor

END@

Thanks in advance
Yaro
Nov 12 '05 #1
  • viewed: 1638
Share:
2 Replies
Take a look at result set locators (ALLOCATE and ASSOCIATE)

Cheers
Serge
Nov 12 '05 #2
> Take a look at result set locators (ALLOCATE and ASSOCIATE)

Thank you for hint.

Yaro

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by maceo | last post: by
5 posts views Thread by Stanley Sinclair | last post: by
3 posts views Thread by Michael C# | last post: by
12 posts views Thread by Mick_fae_Glesga | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.