Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Hi:
On-Line 7.23 using triggers and SPL.
I have a table that has a delete trigger defined. This trigger
calls a stored procedure that among other things calls another
stored procedure.
The second stored procedure updates a table that has a check constraint
defined. In some situations this constraint can be violated, but I do
not care to report an error. I just want to be sure that the data stored
in the table is valid (That is the reason why I have a
constraint). This Stored procedure has the following code.
ON EXCEPTION IN (-530)
RETURN 0;
END EXCEPTION;
To handle the error -530 ( Check constraint (%s) failed).
My problem is:
When in run the stored procedure, using dbaccess or esql/C
and the constraint is violated everything works fine and no error
is reported. But: When I delete something from the table and the
stored procedure is called by the trigger I get the error -530. Is
it a way to avoid getting the error reported when a trigger is used?.
I thing that I could add some code to the stored procedure to verify
that the constraint is not violated, but I would prefer let the engine
do the check for me.
TIA
Tino
Ps: I have also tried
ON EXCEPTION IN (-530)
RAISE EXCEPTION 0,0," "
RETURN 0;
END EXCEPTION;
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.