I am trying to create a trigger that raises an application error when an update is done to a specific field in a table, but I am consistently getting an error message that says there are compilation errors. My code:
Create or replace trigger MaxBudget
Before insert or update of Budget on Project for each row
Begin
If (:new.Budget) > 100000000 then
raise_application_error(-20101, ?Budget too large.?);
End If;
End;
/
And the error message I get states:
3/3 PL/SQL: Statement ignored
3/36 PLS-00201: Identifier 'Budget too large.' must be declared
I guess I'm confused as to why I'm getting this error?
FTR, if I try to use single quotes which I have seen as very common in examples, I get another error that says it's expecting a double-quoted delimited-identifier.
Question
Dave Diller
I am trying to create a trigger that raises an application error when an update is done to a specific field in a table, but I am consistently getting an error message that says there are compilation errors. My code:
And the error message I get states:
I guess I'm confused as to why I'm getting this error?
FTR, if I try to use single quotes which I have seen as very common in examples, I get another error that says it's expecting a double-quoted delimited-identifier.
Any tips would be greatly appreciated!
Link to comment
Share on other sites
1 answer to this question
Recommended Posts