I am having hidden item called P252_UPDATE_DATE, the value of this item assigning through page process and updating in USER table through auto update process.
when i execute below mentioned update statement from background(sql developer) it is updating exact date and time as 21-10-2013 20:15:12.
but when i execute through apex it is updating(auto update) as 21-10-2013 00:00:00.
update user set last_update_date=TO_DATE( to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS'),'DD-MON-YYYY HH24:MI:SS') where user_id=21;
Select TO_DATE( to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS'),'DD-MON-YYYY HH24:MI:SS') INTO :P252_UPDATE_DATE FROM DUAL;
Please suggest me how can i update exact sysdate value by hidden item in apex 4.2.2.
All APEX items are strings. Assigning a DATE value to the :P252_UPDATE_DATE item therefore requires an implicit conversion using the default date format (which will not include the time components) to turn the date value into a string. Remove the outer TO_DATE to avoid the unnecessary implicit conversion.
However, note that this type of audit column is better handled using a PL/SQL API or database trigger rather than in APEX.