Differences between Macro and Stored procedue

Tools
Enthusiast

Differences between Macro and Stored procedue

Hi,

Can any one please tell me the differences between a Macro and Stored procedue as both contains set of sql statements.

Regards,
kiran
1 REPLY
Teradata Employee

Re: Differences between Macro and Stored procedue

Hello,

Following are few differences between MACRO and Stored-Procedure:

MACRO:
- Limited procedural logic
- Can return multi row answer sets for the same request
- Multi-statement request parallelizes multiple single row statements
- Can EXPLAIN a macro
- Can be invoked by a trigger

Stored Procedure
- Sophisticated procedural logic
- Returns a single set of values (Before Teradata 12)
- One request per individually processed statement
- Cannot EXPLAIN a stored procedure. Instead, must EXPLAIN each individual stored procedure SQL statement individually
- Cannot be invoked by a trigger

HTH!

Regards,

Adeel