i have 2 Date field's in oracle 10g (MyDate and MyTime)
and i need to inser开发者_如何学Pythont string that contain a date & time
strDate = 04/01/2010 00:00:00
strTime = 01/06/2010 17:20:12
how to insert strDate & strTime to field's MyDate & MyTime
use the to_date
function to insert a date in Oracle (the Date datatype has both the "date" and "time" component in Oracle):
INSERT INTO your_table(MyDate, MyTime) VALUES (
to_date('04/01/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss'),
to_date('01/06/2010 17:20:12', 'dd/mm/yyyy hh24:mi:ss')
);
精彩评论