Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> conditional cursor selection

conditional cursor selection

From: Seth <sgelberg_at_optonline.net>
Date: 19 Aug 2001 09:21:56 -0700
Message-ID: <f3159b28.0108190821.3b59f910@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US