Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to avoid code redundancy which is varying in parameter that is not null?

886413Jul 18 2014 — edited Jul 18 2014

Hi friends,

I have a piece of PLSQL code(A). I am processing the PLSQL code A based on  2 parameters(param1 and param2) coming from a cursorA .

eg:

CursorA(param1 and param2)

loop

if param1 is not null then

I need to execute PLSQL code(A) based on param1

else

I need to execute PLSQL code(A) based on the param2

enf if

end loop

So my question is, there is a code redundancy (that is I'm executing the same process in PLSQL code(A) in both if and else part the variation is based on the param1 and param2)  in both if and else part ..

What can I do to avoid this code redundancy?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2014
Added on Jul 18 2014
3 comments
265 views