I prefer using PL/SQL Function Returning Error Text while creating validations. Two days ago I discovered a bug - it is not possible to create the function if no error message entered. This bug has been documented and will probably be fixed in 5.1. The workaround is to enter a dummy text like "ERROR" or similar.
Yes , in apex 4.2.4 Error message was allowed to be empty
ReplyDeleteI would say you should't use variable for error text:
ReplyDeleteBEGIN
IF :job='CLERK' and :sal > 3000
THEN
RETURN 'Salary may not exceed 3000 for the job CLERK.';
END IF
END;
but if you want to use variable then you should check it is it empty or null before return:
IF LENGTH(v_error)>0
THEN
RETURN v_error;
END IF;
I would say you should use a name instad of "Anonymous" :) and I would also say "think twice before posting something". ;)
ReplyDeleteDenes Kubicek