cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi Experts,

I want to insert the current Date and time stamp in a field in the Oracle Database Table.

I am able to insert date but i am not able to insert the date with time stamp. Any Suggestions??

Thanks

Naveen

0 Likes
View Entire Topic
Former Member
0 Likes

Naveen,

Do you want to get current date (from sysdate) with a specific format or transform a value containing a date/time value to insert it in ORACLE ?

Usually, you insert current datetimestamp in a date field using this :

TO_DATE(sysdate,'dd/mm/yyyy hh:mi:ss')

you may have to tweak the format pattern ('dd/mm....') according to your needs

if you want to transform a date, use something like this:

TO_DATE(your_date,your_format)

but make sure your format is compliant with your date, ie

TO_DATE('31/12/2008','MM/DD/YYYY') could raise error (litteral does not match) cuz ORACLE can't recognize 31 as a month pattern

Chris