ora-01861

Oracle - literal does not match format string error [duplicate]

那年仲夏 提交于 2019-12-18 05:55:06
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Simple Oracle query: literal does not match format string I am getting the following error: INSERT INTO CatalogueEntry VALUES('2001-12-10', 2, 14.99, 1, 0) ERROR at line 1: ORA-01861: literal does not match format string ` The first field is a DATE format. Any ideas? Thanks. 回答1: When you are inserting a string value to a date column, then you need to convert it to a date during the INSERT using the to_date()

Simple Oracle query: literal does not match format string

为君一笑 提交于 2019-11-29 15:47:59
I want to execute a simple function in Oracle. The signature is defined as follows: CREATE OR REPLACE FUNCTION NewCaseListForValidation ( p_fromDate in DATE, p_toDate in DATE, p_rowCount in INT ) RETURN SYS_REFCURSOR IS return_value SYS_REFCURSOR; ... I should be able to execute it with: var rc refcursor exec :rc := newcaselistforvalidation('2010-01-01','2011-01-01',100); print :rc But when typing "newcaselistforvalidation('2010-01-01','2011-01-01',100)", I get: ERROR at line 1: ORA-01861: literal does not match format string ORA-06512: at line 1 I googled a bit and it seems I can't figure out

Simple Oracle query: literal does not match format string

落爺英雄遲暮 提交于 2019-11-28 10:37:35
问题 I want to execute a simple function in Oracle. The signature is defined as follows: CREATE OR REPLACE FUNCTION NewCaseListForValidation ( p_fromDate in DATE, p_toDate in DATE, p_rowCount in INT ) RETURN SYS_REFCURSOR IS return_value SYS_REFCURSOR; ... I should be able to execute it with: var rc refcursor exec :rc := newcaselistforvalidation('2010-01-01','2011-01-01',100); print :rc But when typing "newcaselistforvalidation('2010-01-01','2011-01-01',100)", I get: ERROR at line 1: ORA-01861:

ORA-01861: literal does not match format string

两盒软妹~` 提交于 2019-11-27 23:25:51
When I try to execute this snippet: cmd.CommandText = "SELECT alarm_id,definition_description,element_id, TO_CHAR (alarm_datetime, 'YYYY-MM-DD HH24:MI:SS'),severity, problem_text,status FROM aircom.alarms WHERE status = 1 and TO_DATE (alarm_datetime,'DD.MM.YYYY HH24:MI:SS') > TO_DATE ('07.09.2008 09:43:00', 'DD.MM.YYYY HH24:MI:SS') order by ALARM_DATETIME desc"; I get: ORA-01861: literal does not match format string There is no problem with database connection because I can execute basic SQL commands. What is the problem with this statement? Remove the TO_DATE in the WHERE clause TO_DATE

ORA-01861: literal does not match format string

只愿长相守 提交于 2019-11-27 04:36:19
问题 When I try to execute this snippet: cmd.CommandText = "SELECT alarm_id,definition_description,element_id, TO_CHAR (alarm_datetime, 'YYYY-MM-DD HH24:MI:SS'),severity, problem_text,status FROM aircom.alarms WHERE status = 1 and TO_DATE (alarm_datetime,'DD.MM.YYYY HH24:MI:SS') > TO_DATE ('07.09.2008 09:43:00', 'DD.MM.YYYY HH24:MI:SS') order by ALARM_DATETIME desc"; I get: ORA-01861: literal does not match format string There is no problem with database connection because I can execute basic SQL

Convert a string date into datetime in Oracle

雨燕双飞 提交于 2019-11-26 14:07:08
问题 How can I convert this string date to datetime in oracle. 2011-07-28T23:54:14Z Using this code throws an error: TO_DATE('2011-07-28T23:54:14Z', 'YYYY-MM-DD HH24:MI:SS') How can this be done? Error report: SQL Error: ORA-01861: literal does not match format string 01861. 00000 - "literal does not match format string" *Cause: Literals in the input must be the same length as literals in the format string (with the exception of leading whitespace). If the "FX" modifier has been toggled on, the