Search within Oracle/OAS
Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Need to simplify an if else statement within a cursor
posted 2 weeks 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.
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
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