How do I combine these 2 example cursors below so that they retrieve data for all 4 conditions: all, candy, cake, popcorn; in a for loop?
I have 3 session/global variables that can be empty string
s_Candy Varchar2(5); s_Cake Varchar2(5); s_Popcorn Varchar2(5);
Cursor My_All_Cur Is ... Gets all values Select * From My_Table t Where t.State = 'A';
Cursor My_Other_Cur Is ... Gets data by condition From My_Table t Where t.State = 'A' And (t.Candy_Lovers = s_Candy Or t.Cake_Lovers = s_Cake Or t.Popcorn_Lovers = s_Popcorn);
For i In My_Unified_Cur Loop ... do stuff End Loop;