1

我的应用程序中有一个代码,它将 java.sql.Timestamp 插入到 oracle 日期列中。这段代码工作正常。但偶尔我会收到错误:

ORA-01858: a non-numeric character was found where a numeric was expected. 

当我看到日志时,同时执行的类似插入是成功的,然后突然一个特定的操作失败了。当我查看不同语句之间的格式时,它们是相似的。猜不出问题。

第一个语句失败了。但第二个已成功插入。

INSERT INTO OMTM_EXECUTE_REPORT(er_id_pk,er_oms_order_id,er_orig_oms_order_id,er_esis_no,er_transaction_no,er_exec_trans_type,er_exec_type,er_ord_status,er_order_rej_reason,er_cust_account,er_settle_type,er_fut_settle_dt,er_security_type,er_symbol_code,er_action,er_ord_quantity,er_ord_type,er_price_per_share,er_stop_price_per_share,er_currency_id,er_time_in_force,er_expire_time,er_last_trd_shares,er_traded_price_per_share,er_leaves_quantity,er_cumulative_qty,er_average_price,er_transact_time,er_trade_date,er_text,er_can_rej_response_to,er_can_rej_reason,er_disclosed_quantity,er_fill_quantity,er_read_flag,er_settle_flag,er_exec_rep_time,er_modified_datetime)
      VALUES      (OMSQ_TM_ID_PK.NEXTVAL,5168,0,08434308,0436594708434308,0,2,2,null,0079027076,9,null,null,ALDAR,BUY,100000,2,5.33,0.0,0,0,2009-12-17 00:00:00.0,100000,5.33,0,100000,5.33,2009-12-17 06:01:54.0,2009-12-17 06:01:54.0,Hold Created Inspite of Insufficient Bal,null,null,0,0,'N','N',SYSDATE,SYSDATE)


INSERT INTO OMTM_EXECUTE_REPORT(er_id_pk,er_oms_order_id,er_orig_oms_order_id,er_esis_no,er_transaction_no,er_exec_trans_type,er_exec_type,er_ord_status,er_order_rej_reason,er_cust_account,er_settle_type,er_fut_settle_dt,er_security_type,er_symbol_code,er_action,er_ord_quantity,er_ord_type,er_price_per_share,er_stop_price_per_share,er_currency_id,er_time_in_force,er_expire_time,er_last_trd_shares,er_traded_price_per_share,er_leaves_quantity,er_cumulative_qty,er_average_price,er_transact_time,er_trade_date,er_text,er_can_rej_response_to,er_can_rej_reason,er_disclosed_quantity,er_fill_quantity,er_read_flag,er_settle_flag,er_exec_rep_time,er_modified_datetime)       
VALUES      (OMSQ_TM_ID_PK.NEXTVAL,5170,0,08434400,0436599708434400,0,2,2,null,0059729784,9,null,null,SOROUH,SELL,82574,2,2.83,0.0,0,0,2009-12-17 00:00:00.0,82574,2.83,0,82574,2.83,2009-12-17 06:04:48.0,2009-12-17 06:04:48.0,null,null,null,0,0,'N', 'N',SYSDATE,SYSDATE)

任何帮助将不胜感激

谢谢

4

2 回答 2

2

2009-12-17 06:01:54.0不是 Oracle 的有效时间戳文字

你需要使用:TIMESTAMP '2009-12-17 06:01:54.0'

尽管令人惊讶的是其中一个陈述实际上有效

于 2010-12-02T10:36:44.250 回答
0

根据你的说法,我想到了两种可能:

  • 你有一个并发问题。您是否正在使用由多个线程同时访问的共享预准备语句或共享连接?
  • 您在 Oracle JDBC 驱动程序中发现了一个错误……您是否尝试更新到最新版本?
于 2010-12-09T09:22:02.133 回答