How to execute a macro using TPT operator? Which TPT operator should be used to execute a macro. I tried SQL Selector Operator but got a syntax error. Looks it can be used only for SELECT statements. We are in the process of converting our BTEQ execute macro jobs into TPT jobs. Looking for an example. Thanks in advance.
Yes, the SQL Selector operator is used only for SELECTs (hence its name).
You can try to use the DDL operator, but it depends on what you are trying to do with the macro.
The DDL operator can be used for most SQL statements, just as long as the SQL statement does not return data to the operator.
Thanks Steve. The name of the operator misled me as execute macro is a DML statement. Tried the DDL operator and it works fine for DML statements that doesn't return values. Thanks again.
Yeah, the operator was originally created to handle just DDL statements, then was expanded, but we cannot change the name.
When in doubt, refer to the documentation for what the operators can and cannot do.
Another simple question. What is the equivalent of BTEQ status values in TPT Selector operator ?
.IF ERRORCODE <> 0 THEN .QUIT 10;
.IF ACTIVITYCOUNT > 0 THEN .QUIT 12;
.IF ACTIVITYCOUNT = 0 THEN .QUIT 0;
I don't know how but maybe someone have any suggestions on how to simulate condition based on ACTIVITYCOUNT anyway ?
Because I really need to introduce a condition in my JOB
As already noted, TPT does not currently support conditional logic.
As far as I know there is no other way to simulate conditional logic.
Why do you want to convert a BTEQ script to TPT?