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!

Nested Case Statements

631922Sep 11 2010 — edited Sep 12 2010
Need to break down the CASE statement so each condition can be tested.
This nested statement currently has me lost.
select
CASE NVL(UPPER(load_cl_item.fd_type_code),'')
WHEN  'B' then 0
ELSE
    case
        when stage_cl_header.gst_ind = 'N' then round(load_cl_item.pd_amount*dim_tax.rate_conv_incl_to_excl, 2)
        else load_cl_item.pd_amount
    end
END,
    load_cl_item.fd_type_code,
    CASE NVL(UPPER(load_cl_item.fd_type_code),'')
       WHEN  'B' then
             case
                when stage_cl_header.gst_ind = 'N' then round(load_cl_item.cl_amount*dim_tax.rate_conv_incl_to_excl, 2)
                else load_cl_item.cl_amount
             end
       ELSE
             case
                when stage_cl_header.gst_ind = 'N' then round(load_cl_item.pd_amount*dim_tax.rate_conv_incl_to_excl, 2)
                else load_cl_item.pd_amount
             end
END,
from etc
l
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2010
Added on Sep 11 2010
4 comments
935 views