🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-14-2020 10:10 AM
(4161 views)
Hi ,
Could you please help me to fix this code ? I didn't understand which is the issue.
I have a Teradata table IRM.Exploitrigger with 2 columns (ID,maxexploit_dt).
I just would like to add a new row with new information on this table.
Many thanks in advance.
/* code*/
proc sql;
connect to teradata
(user=&td_usr. password=&td_pass. server = 'edwprod' database = 'insights_consumer' mode = teradata);
EXECUTE (
CREATE MULTISET VOLATILE TABLE basedate AS
(
select
1 as ID,
max(month_end_dt) as maxexploit_dt
from profitability_sandbox.exploitation_layer_pm
) WITH DATA PRIMARY INDEX(ID) ON COMMIT PRESERVE ROWS) BY TERADATA;
Execute
(
proc sql;
insert into
IRM.Exploitrigger (ID,maxexploit_dt)
( select ID,
maxexploit_dt from basedate)
);
quit;
/* log*/
proc sql;
26 !
27 connect to teradata
28 (user=&td_usr. password=&td_pass. server = 'edwprod' database = 'insights_consumer' mode = teradata);
28 !
29 EXECUTE (
30 CREATE MULTISET VOLATILE TABLE basedate AS
31 (
32 select
33 1 as ID,
34 max(month_end_dt) as maxexploit_dt
35
36 from profitability_sandbox.exploitation_layer_pm
37
38 ) WITH DATA PRIMARY INDEX(ID) ON COMMIT PRESERVE ROWS) BY TERADATA;
39 Execute
40 (
41 proc sql;
42 insert into
43 IRM.Exploitrigger (ID,maxexploit_dt)
44 ( select ID,
45 maxexploit_dt from basedate)
46 );
_
22
ERROR 22-322: Expecting a name.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1. Execute by xxx () contains native teradata SQL between the parentheses.
proc sql; should be removed.
2. Execute must be used with BY.
3. A closing parenthesis is missing.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1. Execute by xxx () contains native teradata SQL between the parentheses.
proc sql; should be removed.
2. Execute must be used with BY.
3. A closing parenthesis is missing.