hehe odd, I just tried;
Code:
BEGIN ATOMIC
IF NOT EXISTS (select * from ABC.table1 where field1 = 1100200)
THEN
INSERT INTO ABC.table1 ("field1") VALUES (1100200);
END IF;
END;
Although that goes on for what seems forever. Doing this;
Code:
BEGIN ATOMIC
IF NOT EXISTS (select * from ABC.table1 where field1 = 1100200)
THEN
INSERT INTO ABC.table1 ("field1") VALUES (1100200);
END IF;
END@
Returns the result of;
Code:
DB2 Database Error: ERROR [42601] [IBM][DB2/NT] SQL0104N An unexpected token "END-OF-STATEMENT" was found following "2,0); END IF; END@". Expected tokens may include: "JOIN <joined_table>". LINE NUMBER=7. SQLSTATE=42601
So still not sure what I am doing wrong.