An external stored procedure that is called when a trigger is fired can only execute SQL statements that are allowed as triggered action statements.
Other statements result in the system returning a failure message to the external stored procedure. An external stored procedure that receives such a message has an opportunity to post the error and close any external files or disconnect any connections it established. The only remaining course of action is for it to return.
|IF the external stored procedure receives a failure message and …||THEN the triggering request is terminated and …|
|returns with its own error by setting the SQLSTATE to its own exception code||the original fail condition will not be known to the caller of the external stored procedure.|
|returns with no error by setting SQLSTATE to '00000'||the system returns the original failure to the caller.|
|attempts to submit another request||the system generates a 7836 error: The XSP db.name submitted a request subsequent to receiving a trigger fail message.|
For more details and a list of SQL statements that are allowed as triggered action statements, see the information about CREATE TRIGGER in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.