omacron
Technical User
- Feb 5, 2002
- 149
Hi
I am new to DB2 and have a simple problem. Trying to get an IF NOT EXIST statement work. Here is my code;
Toad keeps telling me there is an error at the first IF. My googling tells if not exist does work I just can't figure out what I am doing wrong.
I am new to DB2 and have a simple problem. Trying to get an IF NOT EXIST statement work. Here is my code;
Code:
IF NOT EXISTS (select * from ABC.table1 where field1 = 1100200)
THEN
INSERT INTO ABC.table1 ("field1") VALUES (1100200);
END IF;
Toad keeps telling me there is an error at the first IF. My googling tells if not exist does work I just can't figure out what I am doing wrong.