I have the following UPDATE statement in which I'm getting syntax errors pointing to the line right above the FROM clause. The error from Teradata is:
Syntax error: expected something between the word 'First_name' and the 'FROM' keyword
UPDATE DATA.CONTACTS tgt
tgt.LAST_NAME = DATA.PART.LAST_NAME
,tgt.BPP_USER_ID = DATA.PART.User_Id
,tgt.Email_Address = DATA.PART.Email
,tgt.Last_name = DATA.PART.Last_name
,tgt.First_name = DATA.PART.First_name
WHERE EMAIL IN (
qualify count(*) over (partition by email rows unbounded preceding) = 1
The error points to that first FROM clause in the statement. Anything I'm missing? Should I rearrange the clauses at all?
Thanks, looks like that got me past the syntax error.
Now, I'm getting an error saying that I don't have enough spool space. I ran the select statement separately without any errors.
Any idea as to what might be creating spool space problems in the statement?
Spool space issue can be because of reasons like spool for a user is low, skewed data distribution .....
Did you test your explain? Are your stats fine....Which user your are using? Anything running in parallel....
You can break the logic into steps to update your target.