开发者

insert date to oracle

开发者 https://www.devze.com 2023-01-02 18:39 出处:网络
i have 2 Date field\'s in oracle 10g(MyDate and MyTime) and i need to inser开发者_如何学Pythont string that contain a date & time

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')
);
0

精彩评论

暂无评论...
验证码 换一张
取 消