您的位置:程序门 -> java -> web 开发



oracle to_date函数的问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


oracle to_date函数的问题
发表于:2007-07-20 13:34:44 楼主
insert   into   tm_part_main_data   (id,   part_number,   release_date,   mop_code,   replace_relation,   ewo,   replacing_part_number,   data_source,   part_name_en,   confirm_code,   actual_bp_date,   acd_flag,   forecast_bp_date,   service_code,   replace_valid_date,   sourcing,   direct_distribute_flag,   optional,   monitor_flag,   traceable_flag,   main_hidden_flag,   hidden_flag_change_date,   main_sap_flag,   main_sap_flag_finish_date,   package_flag,   package_first_finish_date,   purchase_flag,   purchase_flag_finish_date,   filter_flag,   filter_flag_finish_date,   ref_flag,   ref_flag_finish_date,   purchase_available_date,   package_available_date,   pricing_flag,   pricing_first_finish_date,   package_delay_start_date,   package_delay_time,   purchase_delay_time,   purchase_delay_start_date,   package_hold_time,   buy_flag,   stop_buy_date,   create_by,   purchase_hold_time,   create_date,   purchase_cancel_time,   ccc_flag,   paint_flag,   update_by,   book_hidden_pkg_time,   book_code,   fsu,   qty_of_vehicle,   series_code,   body_code,   hand,   dfs_flag,   provider_flag,   update_date,   book_hidden_phs_time,   upc,   fna)
values   (2015681,   'dnc101410 ',   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   '国产 ',   'usem ',   null,   'dnc90141a ',   '4 ',   'hose&jet   assy-wsh   sys ',   '20061112 ',   null,   'd ',   null,   'n ',   to_date( '11-04-2007   12:10:38 ',   'dd-mm-yyyy   hh24:mi:ss '),   null,   '0 ',   null,   '0 ',   '0 ',   '0 ',   null,   '1 ',   to_date( '25-01-2007   10:59:47 ',   'dd-mm-yyyy   hh24:mi:ss '),   '2 ',   to_date( '25-01-2007   10:34:22 ',   'dd-mm-yyyy   hh24:mi:ss '),   '0 ',   null,   '2 ',   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   '1 ',   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   to_date( '25-01-2007   10:59:47 ',   'dd-mm-yyyy   hh24:mi:ss '),   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   '1 ',   to_date( '25-01-2007   11:22:58 ',   'dd-mm-yyyy   hh24:mi:ss '),   null,   0,   0,   to_date( '25-01-2007   10:59:47 ',   'dd-mm-yyyy   hh24:mi:ss '),   0,   '2 ',   to_date( '02-07-2007   03:00:00 ',   'dd-mm-yyyy   hh24:mi:ss '),   -1,   0,   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   0,   '0 ',   '0 ',   -1,   0,   'w ',   null,   '2 ',   'r1,r2 ',   null,   null,   '1 ',   '1 ',   to_date( '11-04-2007   12:10:39 ',   'dd-mm-yyyy   hh24:mi:ss '),   0,   '0 ',   '0 ');


这个是我从一个数据库中导出的脚本n多语句中的一条,想插入另一张表
在toad中执行的时候一直会弹出
' '   is   not   a   valid   date   or   time  
怎么回事啊  
发表于:2007-07-20 13:55:001楼 得分:0
时间转换没问题,是你字段没有对应好吧,哪个时间字段的对应成空了.
发表于:2007-07-20 13:59:462楼 得分:0
我执行
select   2015681,   'dnc101410 ',   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   '国产 ',   'usem ',   null,   'dnc90141a ',   '4 ',   'hose&jet   assy-wsh   sys ',   '20061112 ',   null,   'd ',   null,   'n ',   to_date( '11-04-2007   12:10:38 ',   'dd-mm-yyyy   hh24:mi:ss '),   null,   '0 ',   null,   '0 ',   '0 ',   '0 ',   null,   '1 ',   to_date( '25-01-2007   10:59:47 ',   'dd-mm-yyyy   hh24:mi:ss '),   '2 ',   to_date( '25-01-2007   10:34:22 ',   'dd-mm-yyyy   hh24:mi:ss '),   '0 ',   null,   '2 ',   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   '1 ',   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   to_date( '25-01-2007   10:59:47 ',   'dd-mm-yyyy   hh24:mi:ss '),   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   '1 ',   to_date( '25-01-2007   11:22:58 ',   'dd-mm-yyyy   hh24:mi:ss '),   null,   0,   0,   to_date( '25-01-2007   10:59:47 ',   'dd-mm-yyyy   hh24:mi:ss '),   0,   '2 ',   to_date( '02-07-2007   03:00:00 ',   'dd-mm-yyyy   hh24:mi:ss '),   -1,   0,   to_date( '25-01-2007   08:36:25 ',   'dd-mm-yyyy   hh24:mi:ss '),   0,   '0 ',   '0 ',   -1,   0,   'w ',   null,   '2 ',   'r1,r2 ',   null,   null,   '1 ',   '1 ',   to_date( '11-04-2007   12:10:39 ',   'dd-mm-yyyy   hh24:mi:ss '),   0,   '0 ',   '0 '   from   dual  
执行上边的语句没问题
但是执行这句的时候,要求输入参数, 'hose&jet   assy-wsh   sys '这个值中的 "&jet "被当成参数了.


快速检索

最新资讯
热门点击