Search error ORA-00932: inconsistent data types: expected DATE received NUMBER

When I try to run this request, I get the above error. Can someone help me on this

UPDATE CCO.ORDER_CREATION SET "Doc_Date" = 8/9/2013 WHERE "Document_Number" IN (3032310739,3032310740,3032310738) 
+4
source share
4 answers

try it

 UPDATE CCO.ORDER_CREATION SET "Doc_Date" = TO_DATE('8/9/2013', 'MM/DD/YYYY') WHERE "Document_Number" IN (3032310739,3032310740,3032310738) 

Also check this out

+3
source

8/9/2013 - numerical value: 8 divided by 9 divided by 2013.

You must use the to_date() function to convert the string to a date:

 UPDATE CCO.ORDER_CREATION SET "Doc_Date" = to_date('08/09/2013', 'dd/mm/yyyy') WHERE "Document_Number" IN (3032310739,3032310740,3032310738); 

You may need to adjust the format mask, as it is unclear whether you have August 9 or September 8

Alternatively, you can use the ANSI date literal (the format is always yyyy-mm-dd for the ANSI SQL date literal):

 UPDATE CCO.ORDER_CREATION SET "Doc_Date" = DATE '2013-09-08' WHERE "Document_Number" IN (3032310739,3032310740,3032310738); 
+6
source

You are currently passing the date as a number string, converting it to a date, and then trying to insert as shown below

 UPDATE CCO.ORDER_CREATION SET "Doc_Date" = TO_DATE('8/9/2013','MM/DD/YYYY') WHERE "Document_Number" IN (3032310739,3032310740,3032310738) 
+1
source

Here is how I see it:

 UPDATE CCO.ORDER_CREATION tbl1 SET tbl.Doc_Date = TO_DATE('08/09/2013', 'MM/DD/YYYY') WHERE tbl1.Document_Number IN (3032310739,3032310740,3032310738) 
0
source

Source: https://habr.com/ru/post/1497945/


All Articles