plsql - PL/SQL - to_char within DECODE -
i have decode statement works fine without putting to_char function in
select decode(info.make_date, null,'select all',info.make_date) "listitemkey" however need info.make_date in specific date format, use to_char
select decode(info.make_date, null,'select all',to_char(info.make_date, 'mm/dd/yyyy')) "listitemkey" but when unexpected '<' json instead of data need return. there reason can't set info.make_date format need here?
i guess alternative below. please try , let me know if works.
select case when info.make_date null 'select all' else to_char (info.make_date, 'mm/dd/yyyy') end "listitemkey" however cast date before using to_char existing decode:
to_char (to_date(info.make_date, 'mm/dd/yyyy'), 'mm/dd/yyyy' )
Comments
Post a Comment