try/catch + trancount

Database
Enthusiast

try/catch + trancount

Hi,

I have stored procedure sql server code:

 

 

if ( <condotion>)

begin

                begin try

                                begin tran

         <statments>

commit tran

                end try

               

                begin catch

                                if @@trancount>0 rollback tran

                end catch

end

 

I would like to convert this code to teradata T-mode (within stored procedure).

Any idea how i'm codeing this on teradata?

Thanks in  advance

Sheron

 

1 REPLY
Teradata Employee

Re: try/catch + trancount

You would Declare a Condition for trancount > 0, and Declare a Continue Handler for that condition.  For details, go to info.teradata.com and get the "SQL Stored Procedures and Embedded SQL" manual for your Teradata release.