Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> IF NOT EXISTS SELECT ...
I would like to test the existence of rows as condition in a PL/SQL if-clause:
IF NOT (EXISTS SELECT * FROM table WHERE col = value) THEN
...
END IF;
but Oracle complains about the syntax. I tried different variations
with/without parentheses without success.
Apparently, the EXISTS operator may only be used in subqueries.
Can you help?