Answer Posted / janardhanreddy
Macro: It is a collection of SQL queries preferably DML statments and it is stored as an object in DD(Data Dictionary). Unlike VIEWS (we will deal about Views in another post), a macro can have multiple sequels. It is known that a macro can handle many DML and it is restricted to only one DDL.
Reason: DDL statements like Create,Alter,Drop,Rename generally locks the DD for their processing, since macros transaction is an internal process it is highly dependent on DD. Therefore DDL can be last statement in a macro. - This is what provided as theoretical explanation .
Example:
CM AS // CM doesnt work with Queryman better try with BTEQ
or
CREATE MACRO MyMacroName AS
(
insert into (eno,name,ereqno) emp values (101,'Rajesh',43243259);
select * from emp;
//DDL stmt here (doesnt work with queryman)
)
Issue: There is an issue with macro that, DDL couldnt be even as last statement in a macro(with Queryman). I used Teradata 12 and I am getting Warning as Data Dictionary must be solitary. I will update after working with BTEQ.
Parameterized Macro:
//paramNum is passed as Parameter to Select statement.
//passed parameter shd be accessed using =:paramname
CREATE MACRO macro_name (paramNum integer) AS
{
DMLs here....
select ename,esal from emp where eno = :paramName ;
};
REPLACE Macro:
If you require more DMLs to be added to an existing macro, you can use
REPLACE MACRO AS
{[insert];
[update];
[delete];
[select];);
To Execute Macro:
EXEC []
eg: exec myfirsmacro_name;
exec myfirsmacro_name (invalue=1,invalue='abc');
To Drop:
DROP MACRO macro-name;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is mean by complex business rule ?
write sql query vertical to horiozontal following table id name 1 100 2 dinesh 3 india 1 101 2 suresh 3 india 1 103 2 prakesh 3 usa i want output like id name country 100 dinesh india 101 suresh india 103 prakesh usa
Explain the use of aggregator cache file?
What is workflow? What are the components of the workflow manager?
What are active and passive transformations?
in u flatfile some of fact records are missed then u load the diminision records are not if u load diminsion records what about fact table records
Which files are created during the session rums by informatics server?
What are roles and groups and benefits of using them?
What is rank transformation?
What is the command used to run a batch?
Explain the shared cache and re-cache?
What are the main features of Oracle 8i with context to datawarehouse?
Hi friends I want to know about what r the dimensions in the banking porjects and genarally how many tables r in project ?
What are the conditions needed to improve the performance of informatica aggregator transformation?
In informatics server which files are created during the session rums?