This discussion is archived
3 Replies Latest reply: Feb 6, 2013 3:10 AM by Gus C RSS

APEX_ITEM.MD5_CHECKSUM and Case Statements

Gus C Journeyer
Currently Being Moderated
I have an updateable report
select apex_item.display_and_save(3,parameter) ||
APEX_ITEM.MD5_CHECKSUM(parameter,value_char,value_number,to_char(value_date,'dd.mm.yyyy'),param_set) ||
apex_item.hidden(2,rownum) parameter 
,value_char value_char_current
,APEX_ITEM.TEXT(4,value_char,20,128) value_char_new
,case when parameter in ('OBJINCID', 'HISTTRANSFERID') then '<span style="color:#000000;font-weight:bold">'||value_number||'</span>' 
            else to_char(value_number) end  value_number_current
,APEX_ITEM.TEXT(5,value_number,10) value_number_new
,case when parameter = 'TRANSFERDAY' then '<span style="color:#000000;font-weight:bold">'||to_char(value_date,'dd.mm.yyyy')||'</span>' 
            else to_char(value_date,'dd.mm.yyyy') end value_date_current
,APEX_ITEM.DATE_POPUP2(6,value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR') value_date_new
,apex_item.display_and_save(7,param_set) param_set
,apex_item.display_and_save(8,param_type) param_type
,APEX_ITEM.TEXT(9,jobname) jobname
,system system
,config config
,APEX_ITEM.TEXT(10,parameter) parameter_hid
,APEX_ITEM.TEXT(11,value_number) vnhid
,APEX_ITEM.DATE_POPUP2(12,value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR') vdhid
from etl_job_param
where config = substr(:P285_CONFIG,instr(:P285_CONFIG,'_')+1) 
and system = :P285_SYSTEM
I would like to change my sql for the value_date_new col to
,case when parameter = 'TRANSFERDAY' then 
APEX_ITEM.DATE_POPUP2(6,NULL,'DD.MM.YYYY','15','10','style="" disabled="disabled"',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')
else
APEX_ITEM.DATE_POPUP2(6,value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')  end value_date_new
I think I need to change my checksum so if parameter = 'TRANSFERDAY' then use the value from the vdhid column and not value_date_new.
It is not allowing me to use column alias in the checksum

How do I do this ?

Gus

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points