PL/SQL (MOSC)

MOSC Banner

cursor value as sql statement where condition in anonymous stored procedure

edited Nov 22, 2019 1:08PM in PL/SQL (MOSC) 7 commentsAnswered

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.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center