Help with update statement

Database
Enthusiast

Help with update statement

UPDATE

   ENTPR_INTEL_TDW.VBC_MBR_ATTRBTN_RSLT

FROM 

ENTPR_INTEL_TDW.VBC_MBR_ATTRBTN_RSLT MBR      

LEFT JOIN

entpr_vbcm_r3.vbc_prov_pgm_xwalk a      

ON MBR.ATTRBTN_PROV_PGM_FILLR_NM = a.vbc_prov_pgm_nm

SET

   MBR.ATTRBTN_PROV_PGM_NM = a.vbc_prov_pgm_id  

WHERE

   MBR.MBR_ATTRBTN_RSLT_ID = 38087853

2 REPLIES
Enthusiast

Re: Help with update statement

Whats the issue? I suspect the syntax may not be correct.

Teradata Employee

Re: Help with update statement

Syntactically: when the FROM clause includes the target table, use the alias before the FROM. Never use the alias on left hand side of SET.

UPDATE MBR

FROM ENTPR_INTEL_TDW.VBC_MBR_ATTRBTN_RSLT MBR

LEFT JOIN ENTPR_VBCM_R3.VBC_PROV_PGM_XWALK A

ON MBR.ATTRBTN_PROV_PGM_FILLR_NM = A.VBC_PROV_PGM_NM

SET ATTRBTN_PROV_PGM_NM = A.VBC_PROV_PGM_ID

WHERE MBR.MBR_ATTRBTN_RSLT_ID = 38087853;