I am writing a deployment script that includes a MERGE
into a view that may or may not exist in one of many target schemas (schemii? schemata?).
I am attempting this SQL:
DECLARE
BEGIN
/* MERGE statement that will work if the view is available */
EXCEPTION
WHEN OTHERS THAN
DBMS_OUTPUT.put_line('warning: merge target is not available');
END;
When I run this block I get the standard "PL/SQL: ORA-00942: table or view does not exists" error.
How can I trap this error and generate a warning line instead?