Monday, June 1, 2020

CASE Statement

select 
       case when status != 'Closed'
            then '<a href="'||apex_util.prepare_url('f?p='||:APP_ID||':2:'||:APP_SESSION||':::2:P2_ROWID:'||ROWID) || '"><img src="#IMAGE_PREFIX#menu/pencil2_16x16.gif" alt="edit"></a>' 
            else '&nbsp;'
            end edit_link,
       PROJECT,
       TASK_NAME,
       STATUS,
       ASSIGNED_TO,
       BUDGET,
       COST,
       case when status = 'On-Hold' then 0
            when status = 'Closed'  then cost
            else budget
            end estimated_cost
from EBA_DEMO_IR_PROJECTS

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...