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!

Is it advisable to call Function directly in Case statement?

Jeevanantham VAug 27 2019 — edited Aug 27 2019

Pseudo code of my actual code:

create function CALCULATE_nu ( a number, B number )

return number as

c number;

begin

C := a+ B;

return c;

end;

/

set serveroutput on;

begin

  case when CALCULATE_NU (5,7) > 10 then

    DBMS_OUTPUT.PUT_LINE('Number is greater than 10');

  else

    DBMS_OUTPUT.PUT_LINE('Number is less than 10');

  end case;

end;

/

During Code review, my reviewer asked me to store the Function- return value in varaible and validate by if or case statement. Can anyone tell me the difference between calling directly in Case statement or proposed method different?

Is there any issue in calling Function in case statement like above code?

Comments

Gianni Ceresa

Hi,

If you search (yes, because this topic was already covered few times) you will find that the solution is more a workaround: hide the breadcrumb.

This can be done by a piece of CSS and you can find the code by using the developer toolbar of your browser.

1617231

Hi thanks, I saw that CSS was n option but we have more than 150 pages so was hoping for a more permanent solution. Thanks for replying

Gianni Ceresa

Why to not add the required CSS in your custom style/skin CSS file? So it's it's on all the pages using the same style/skin by default without editing every single page.

1 - 3

Post Details

Added on Aug 27 2019
6 comments
2,898 views