Search within Oracle/OAS
Register / Login
Win a copy of
Functional Design and Architecture
this week in the
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Need to simplify an if else statement within a cursor
posted 6 months ago
Number of slices to send:
Optional 'thank-you' note:
I have a multi if-else statement inside a REF CURSOR that is part of a packaged function. There are four possible conditions and two possible select statements within the four:
BEGIN IF param1 = 1 AND param2= 3 THEN c_stmt_str :=' SELECT statement 1 '; ELSIF param1 = 0 AND param2 = 3 THEN c_stmt_str :=' SELECT statement 2 '; ELSIF param1 = 1 AND param2 = 4 THEN c_stmt_str :=' SELECT statement 1 '; ELSIF param1 = 0 AND param2 = 4 THEN c_stmt_str :=' SELECT statement 2 '; END IF;
I have been asked to convert this to use an EXPLICIT CURSOR. I would like to simplify this as such. Any help is greatly appreciated.
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
Thread Boost feature
Boost this thread!
function call within a procedure error !!
Cursor Inside if is it Possible?
java stored procedure problems
Set Chained OFF error while executing from my Bean
how to put Nested conditions in sql query