Archives of the TeradataForum
Message Posted: Wed, 20 May 2009 @ 15:53:11 GMT
Subj: | | Re: Create Statement in Macro |
|
From: | | Michael Larkins |
Hanumath:
Since you are trying to CREATE TABLE and INSERT, the INSERT is causing your error. In a macro DDL has to be the last statement of the
transaction and you are placing a DML statement.
To get around this situation you can use the CREATE volatile TABLE new_name AS SELECT. This way the CREATE is the last statement of the
macro/transaction. Don't forget to include your WITH DATA and ON COMMIT PRESERVE ROWS.
Regards,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
|