Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> conditional cursor selection
cursor1.........
WHERE (a.status in ('V', 'A')) and
(a.symbol = b.symbol) AND
(a.ord_type = 'L') AND
((a.side = 'B') AND (a.limit_price >= b.bid_price)) OR
((a.side = 'A') AND (a.limit_price <= b.ask_price))
cursor2......... WHERE (a.status in ('V', 'A')) and
(a.symbol = b.symbol) AND
(a.ord_type = 'L') AND
((a.side = 'B') AND (a.limit_price < b.mid_price)) OR
((a.side = 'A') AND (a.limit_price > b.mid_price))
cursor3......... WHERE (a.status in ('V', 'A')) and
(a.symbol = b.symbol) AND
(a.ord_type = 'L') AND
((a.side = 'B') AND (a.limit_price >= b.bidrel_price))
OR
((a.side = 'A') AND (a.limit_price <= b.askrel_price))
I would like to select one cursor or the other based upon some value, for example (psuedocode):
If (X) then
FOR activeRec in cursor1 LOOP
else
If (Y) then
FOR activeRec in cursor1 LOOP
else
If (Z) then
FOR activeRec in cursor1 LOOP
Any thoughts..dynamic sql, use open and fetch instead of for... Received on Sun Aug 19 2001 - 11:21:56 CDT