Executing several Macros in a Macro

Database
Enthusiast

Executing several Macros in a Macro

Is there a difference between executing several macros in one macro instead of executing them individually?

When I merge them into one macro I get timeout errors predefined by DBAs where as they execute fine when I execute them individually.

Is this because teradata wont commit the transaction until all the macros are exectued? How can I get around this one as I wanted to do this in one step?

Tags (1)
4 REPLIES
Junior Contributor

Re: Executing several Macros in a Macro

Hi Raghu,

all SQL within a macro (including nested macros) is treated as a Multi Statement Request, i.e. a single transaction.

If you don't need everything in a single transaction you should execute them seperatly. Why do you want to it in a single call?

Enthusiast

Re: Executing several Macros in a Macro

Thanks for your response Dieter..That makes sense

I thought it would be more clean scheduling wise...so that I can add or remove macros from 1 Master Macro as I want with no work on scheduler job... Now I have to create 5 different jobs executing 5 macros which takes same input parameters...

Which I think is fine but I thought we can commit the transaction using some explicit command while executing master macro. Now that after little bit of thinking I understand that what I am asking would directly violate the core purpose of a macro.....  :) 1 macro is 1 transaction....

Enthusiast

Re: Executing several Macros in a Macro

why not use a wrapper shell script and run a cron(scehdule) for this shell which will contain all the macros?

Enthusiast

Re: Executing several Macros in a Macro

Yes..I will use Powershell script and will schedule in windows scheduler. We only have a windows server to schedule jobs.