Toad World® Forums

Teradata Macro Creation Problem


#1

I am using the 2.7.0.89 beta, and I am having trouble writing macros in Teradata (since there is no native support in TDA, I am using an ODBC connection). When I run a Create Macro I get the Teradata ODBC error: "[Teradata][ODBC Teradata Driver][Teradata Database] Syntax error, expected something like ‘)’ between ‘;’ and the end of the request. " In other editors, it runs fine. If I try to use parameters in the macro, TDA will prompt me for values for the parameters instead of creating the macro. TDA does run the macros correctly once they have been created; however. I am wondering if this could be fixed in a future beta. Here are a couple of examples (both have been tested and work fine):

–Macro with no parameters
Create macro o101183.STR_TEST as(
select id_str from msi_vw.v_dim_store;);

–Macro with parameters
Create macro o101183.PG_TEST(
DscCmpgn varchar(50),
StartDate date,
EndDate date)
as(
select a.MCLU_ROLLUP as MCLU_MSTR, cast(count(*) as decimal(10,2)) as cnt
from CORE_VW.V_CATALINA_LOYALTY_TIER b,
(select distinct MCLU, MCLU_ROLLUP from o101183.CMPGN_MSTR where dsc_cmpgn = :DscCmpgn) a
where market in (select distinct id_str from o101183.CMPGN_MSTR_STRS where dsc_cmpgn = :DscCmpgn)
and dstrb_date between :StartDate and :EndDate
and a.mclu = b.mclu
group by MCLU_ROLLUP
order by MCLU_ROLLUP;);


#2

Yes. I think we could add a pass-through execute. This would simply send to the
database without trying to parse for parameters or other syntax.

CR76,051. We will see if we can get into one of the upcoming Beta’s.
Probably not the next one but the one after.

Debbie


#3

I created a few macros with parameters in the 3.3 Beta. I assume the fix has gone in. Thanks.


#4

I created a few macros with parameters in the 3.3 Beta. I assume the fix has gone in. Thanks.