DB2 10.5 on Windows
I am trying to delete a lot of data from a table. I created a duplicate of the table with a different name and am trying to move the last years worth of data to it, then truncate the original data and then move the saved data back to the original.
There is an ID column that is set up like this.
ID INTEGER NOT NULL GENERATED ALWAYS
AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20,
NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER)
When I run this to move the data back
INSERT INTO ORIGINAL_TABLE OVERRIDING SYSTEM VALUE (SELECT * FROM DUPLICATE_TABLE WHERE DATE(LASTTIME) >= '01-01-2017')
I get this
ERROR  [IBM][DB2/NT64] SQL0104N An unexpected token "OVERRIDING SYSTEM VALUE" was found following "ORIGINAL_TABLE". Expected tokens may include: "<space>".
Everything I have read says the OVERRIDING SYSTEM VALUE should work but it does not. I am sure it is a simple issue but I have wasted 1/2 a day on trying to figure it out. Any help would be greatly appreciated!!