cursor value as sql statement where condition in anonymous stored procedure
Hi All SET SERVEROUTPUT ON DECLARE BEGIN FOR i in (SELECT DISTINCT(ABC) FROM TEST) LOOP EXECUTE IMMEDIATE 'SELECT * FROM TEST WHERE ABC='here is where i value should be passed''; (this where condition may produce multple rows too) END LOOP; END; / first thing, I do not know how to password 'i' or i.abc value in where condition and other thing do we have to use bulk collect into as it can fetch multiple rows.. and it needs to be displayed. Thanks MS.