Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Need Solution/reason for "7609: Fetch statement is incompatible with current CURSOR definition" - forum topic by SagarNagalkar

$
0
0

REPLACE PROCEDURE MyDataBName.sp1 (IN parIn1 VARCHAR(100), OUT par1 VARCHAR(30), OUT Par2 VARCHAR(30))
BEGIN
DECLARE CurStr VARCHAR(500);
DECLARE projcursor CURSOR FOR S1;

SET CurStr = MyQuery;

PREPARE S1 FROM CurStr;
OPEN projcursor;
	Label1:
	LOOP
		FETCH projcursor INTO par1, par2;
		IF (SQLSTATE = '02000') THEN 		LEAVE label1;		END IF;
	END LOOP label1;
CLOSE projcursor;
END;

MyQuery  contains the select statement with "where" clause. I m using LIKE to fliter the records base on parIn1 .
Thanks

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>