I have the following…
IF CONDITION1 THEN
-- SELECT STATEMENT MIGHT RETURN DATA
IF CONDITION2 THEN
-- SELECT COUNT
IF CONDITION3 THEN
INSERT INTO TABLE
(
---
)
VALUES (
---
);
End IF;
END IF;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN;
END of Trigger
Is this a correct way of handling exception for select statement inside CONDITION1?
PL/SQL has no way to return to the site of the error, so you need to create a block around the portion you want to ignore specific errors:
An alternative is to use an explicit cursor, which does not return an error when it is empty: