Update query problems

Database
Enthusiast

Update query problems

Here is the query I am using:

 

UPDATE patron
FROM DB1.PATRON patron, 
(SELECT * FROM DB1.PatronLN_NoHmac_14p_435 AS tmp
INNER JOIN DB2.PATRON pat ON pat.Patron_ID = tmp.TM_Patron_id)AS patron_TM
SET
Term1 = patron_TM.Term1,Term2 = patron_TM.Term2,Term3 = patron_TM.Term3,Timestamp_val = CURRENT_TIMESTAMP(0)WHERE patron.id1 = patron_TM.id2 
AND patron.ident = 'AB' 
AND patron.Term1 IS NULL 
;

 

And here is the error: 

 

UPDATE failed. [3994] Alias name defined should be used instead of table name patron.

 

I think I am using correct alias values here. Please help.

This is TD15 btw.

 

Thanks in advance


Accepted Solutions
Teradata Employee

Re: Update query problems

The name "patron"  has been made ambiguous. Try an alias which is something other than a table name in the query.

1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: Update query problems

The name "patron"  has been made ambiguous. Try an alias which is something other than a table name in the query.

Enthusiast

Re: Update query problems

That worked perfectly.... Thank you!!!

Wow....just when you think TD update can not get any weirder....... :D