尝试使用每个舞者更新oracle数据库上的时间戳时,我收到以下错误。
ORA-01858: a non-numeric character was found where a numeric was expected.
代码:
my $fmt = 'YYYY-MM-DD HH24:MI:SS:FF3';
database->do("alter session set nls_timestamp_format = '$fmt'");
my $time_start =params->{'start1'};#2014-04-29 10:21:42:037
my $time_stop = params->{'stop1'}; #2014-04-29 10:42:08:355
my $id = params->{'id'};
my $timestart ="TO_TIMESTAMP('$time_start','YYYY-MM-DD HH24:MI:SS:FF3')";
my $timestop ="TO_TIMESTAMP('$time_stop','YYYY-MM-DD HH24:MI:SS:FF3')";
database->quick_update($table, {ID => $id}, {SBYS_START_TIME => $timestart, SBYS_STOP_TIME =>$timestop});
答案 0 :(得分:0)
我在这里看到了两种可能性:
要检查这一点,请添加一个快速调试行:
my $time_start = params->{'start1'};
debug $time_start;
my $time_stop = params->{'stop1'};
debug $time_stop;
尝试上旧学校。:
my $timestart ="TO_TIMESTAMP('" . $time_start . "','YYYY-MM-DD HH24:MI:SS:FF3')";
my $timestop ="TO_TIMESTAMP('" . $time_stop . "','YYYY-MM-DD HH24:MI:SS:FF3')";
这将消除这种可能性。