current position:Home>There is no problem in the execution of the same SQL, sqlplus and PLSQL, and the background reports an exception ora-01855: AM / a.m. or PM / p.m. required

There is no problem in the execution of the same SQL, sqlplus and PLSQL, and the background reports an exception ora-01855: AM / a.m. or PM / p.m. required

2022-01-27 03:58:38 CSDN Q & A

Linux application server ,Linux database server , The database is oracle

The background is executing a query sql Times wrong

Caused by: java.sql.SQLDataException: ORA-01855: AM/A.M. or PM/P.M. required

Executive sql, Remove excess parts, like

select to_timestamp('1970-1-1 12:00:00.000  In the morning ','yyyy-mm-dd hh:mi:ss.ff AM')from dual;

stay sqlplus and plsql There is no problem in the implementation of the project
Both the application server and the database server have environment variables set

export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"

How to solve it , Try not to modify the code




Refer to the answer 1:

NLS_DATE_LANGUAGE, Only Chinese supports morning




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270358342982.html

Random recommended