Using ON DUPLICATE KEY UPDATE
i want to add a row to a database with insert but when inserting if a row exists with the same unique key i want to update the row. e.g
CODE:
INSERT INTO FILETERCALENDAR ( c_DATE, ONCE_WINDOW) values ('13/MAR/2013',1) ON DUPLICATE KEY UPDATE ONCE_WINDOW=1;
I am getting the following error:
ERROR:
Error starting at line 1 in command:
INSERT INTO FILETERCALENDAR ( c_DATE, ONCE_WINDOW) values ('13/MAR/2013',1) ON DUPLICATE KEY UPDATE ONCE_WINDOW=1
Error at Command Line:1 Column:77
Error report:
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
It gives "SQL COMMAND NOT PROPERLEY ENDED" error. Which I do not understand why as if you see the query it is correct.
Questions
Can Anyone help what is wrong with the above QUERY Please?