hi
assign the output to a variable then compare the result with 0 then u can
have only one call to the function.

On Wed, Feb 20, 2013 at 3:11 AM, Gayathri <gd0...@gmail.com> wrote:

> Hi All,
>
> Need suggestion on how to do this.
>
> In a PL/SQL block, have an expression like below -
> where 2 functions are called and result is added together.
> v_result := getbasevalue(....) + getpricediff(....)
>
> Function getpricediff(...), if returns value less than 0, then it should
> be substituted as '0' (zero) else whatever value is calculated.
>
> this is what i am looking for -
> v_result := getbasevalue(....) + case if getpricediff(....) < 0 then 0
> else getpricediff(....) end
>
> any better way to achieve this without calling the function twice?
>
> Thanks in advance!
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Oracle PL/SQL" group.
> To post to this group, send email to Oracle-PLSQL@googlegroups.com
> To unsubscribe from this group, send email to
> oracle-plsql-unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/Oracle-PLSQL?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Oracle PL/SQL" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to oracle-plsql+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Oracle PL/SQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to oracle-plsql+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to