Issue with replace and excuting Macro in Teradata

Database
Enthusiast

Issue with replace and excuting Macro in Teradata

This is my first time in Teradata Studio and I currently trying to run a code containing a macro for the date. In particular, the syntax for the code is something like this:

 

REPLACE MACRO peilerman.DATES

(STARTDATE DATE

,ENDDATE DATE)

AS

 

(SELECT *
FROM Test
where "test_date" between :StartDate and :EndDate;);


EXECUTE peilerman.DATES
(date '2017-01-01' - (INTERVAL '3' YEAR)
,date '2017-01-01');

 

However I keep getting the following error message for the Replace and Excute: Failed [3722 : HY000] Only a COMMIT WORK or null statement is legal after a DDL Statement.

 

What change do I have to do with my code in order to get this macro to work. thanks.

 


Accepted Solutions
Enthusiast

Re: Issue with replace and excuting Macro in Teradata

Nevermind, I got the macro to work.

1 ACCEPTED SOLUTION
1 REPLY
Enthusiast

Re: Issue with replace and excuting Macro in Teradata

Nevermind, I got the macro to work.