tags:

views:

41

answers:

1

Hi will date datatype hold datetime? its not taking datetime.

i have to store datetime into a field in table, for that which datatype i have to use?

Thanks, Srikanth

+3  A: 

The date field does hold date time but you'll need to use the to_date function

for example, if you're trying to insert 2009/01/04 09:00:00 you will use

insert into table_name
(date_field)
values
(to_date('2010/01/04 09:00:00', 'yyyy/mm/dd hh24:mi:ss'));

Note the datetime mask used to tell the field what format the data is arriving in

Kamal
is there any datatype which defaultly can hold datetime?
musicking123
The Oracle DATE data type holds date and time information.
Nick Pierpoint
thanks for ur information.........
musicking123