469,306 Members | 1,901 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

SQL SP ....

Why is this simple SQL SP not returning any results? It is running fine
(gives RC=0) but just not returning the result set.

CREATE PROCEDURE SQLSP9
(
IN PWORKDEPT CHAR(3)
, OUT v_sqlcode INTEGER
, OUT v_sqlstate CHAR(5)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE SQLCODE INTEGER DEFAULT 0;
DECLARE SQLSTATE CHAR(5) DEFAULT '00000';
DECLARE V_DUMMY CHAR(1);
DECLARE C1 CURSOR FOR SELECT FIRSTNME FROM db2admin.EMPLOYEE WHERE
WORKDEPT = PWORKDEPT;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SET V_SQLCODE = SQLCODE;
SET V_SQLSTATE = SQLSTATE;
END;
OPEN C1;
END
@

TIA
Raquel.

Nov 12 '05 #1
1 1184
Oops forgot the WITH RETURN clause in the cursor declaration. That solved
it.

Thanks.
Raquel.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.