Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to evaluate if a filed is NULL or not in a table and based on which I want to assign a status in another filed in the table(like a flag)
//if (EVENT_COMMENT='-' ,'ACTIVE','HANDLED') as FINAL_ALERT_STATUS
//if(len(trim("EVENT_COMMENT"))='0','ACTIVE','HANDLED') as FINAL_ALERT_STATUS
//if(ISNULL(EVENT_COMMENT),1,0) as FINAL_ALERT_STATUS
if(len(trim(EVENT_COMMENT))=0,'ani') as FINAL_ALERT_STATUS
I tried all the above options but nothing seems to work.Can someone plz help on this?
if(len(trim(EVENT_COMMENT))=0,'ani') as FINAL_ALERT_STATUS
This looks basically correct to me. You might want to do something like this though:
if(len(trim(EVENT_COMMENT))=0,'ACTIVE','HANDLED') as FINAL_ALERT_STATUS