从 java 插入时出现 ORA-01858 Oracle 日期问题

发布于 2024-10-05 05:09:55 字数 2257 浏览 6 评论 0原文

我的应用程序中有一个代码,它将 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)

任何帮助将不胜感激

谢谢

I have a code in my application which inserts java.sql.Timestamp into oracle date column. This code works fine. But occasionally i get the error :

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

When i see the log, similar inserts executed at the same time are successful and then all of a sudden one particular operation fails. When i look at the format between different statements, they are similar. Could not guess the problem.

The first statement failed. But the second has got inserted successfully.

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)

Any help would be highly appreciated

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

酒中人 2024-10-12 05:09:55

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

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

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

2009-12-17 06:01:54.0 is not a valid timestamp literal for Oracle

You need to use: TIMESTAMP '2009-12-17 06:01:54.0'

Although it's surprising that one of those statements actually works

素罗衫 2024-10-12 05:09:55

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

  • 您遇到了并发问题。您是否使用共享准备语句或共享连接,由多个线程同时访问?
  • 您在 Oracle JDBC 驱动程序中发现了一个错误...您是否尝试更新到最新版本?

From what you said, two possibilities come to my mind:

  • You have a concurrency problem. Are you using a shared prepared statement, or a shared connection, accessed by multiple threads concurrently?
  • You found a bug in the Oracle JDBC driver... did you try updating to the newest version?
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文