|
Archives of the TeradataForumMessage Posted: Tue, 20 May 2008 @ 21:23:16 GMT
Hi David: The problem with a macro and DDL is that a macro is a transaction and DDL has to be the last thing in a transaction. If it is the first thing and the last thing, it is the only thing. You would have to create the table with a derived table CT new_table as (sel ...) with data The advantage is that you can do .if errorcode within the macro or any BTEQ script. Have you considered using TPump, MLoad or FastExport for this? They have the Preliminary phase with the ability to build dynamic SQL and check error (&SYSRC). Command Functionality .ACCEPT - Read an input record that provides one or more parameter values for variables .BEGIN - Invoke one of the utilities .DATEFORM - Define the acceptable or desired format for a date in this execution as either (YY/MM/DD) or (YYYY-MM-DD) .DISPLAY - Write an output message to a specified file .END - Exit the utility .IF/.ELSE/.ENDIF - Compare variables and values to conditionally perform one or more operations .LOGTABLE - Specify the restart log .LOGON - Establish a Teradata session .LOGOFF - Terminate a Teradata session .ROUTE - Write output to a specified file .RUN - Read and run commands stored in an external script file .SET - Establish or change a value stored in a variable .SYSTEM - Allows for the execution of a command at the computers operating system level from within the script In the scenerio I am thinking about you would never do a .BEGIN so that the actual utility never runs. Just a thought, Michael Larkins
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||