Equivalent of PRAGMA AUTONOMOUS TRANSACTION ?

Database
The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.

Equivalent of PRAGMA AUTONOMOUS TRANSACTION ?

Is there any Teradata equivalent of Oracle's "PRAGMA AUTONOMOUS TRANSACTION" option?

Use case:

I have a procedure whose only purpose is to log something into a log table.

This routine is called many times from many different procedures.

If a parent routine has an exception, and a ROLLBACK occurs, I don't want to rollback the log table! The log table must always be committed.

 

Thank you.

1 REPLY
Teradata Employee

Re: Equivalent of PRAGMA AUTONOMOUS TRANSACTION ?

Hi.

 

In Teradata this can be done with EXCEPTION HANDLERS.

 

When an exception is raised, the current transaction is rolled back, and then the handler takes over: you can put there the logging action.

 

HTH.

 

Cheers.

 

Carlos.