Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Merge Syntax - forum topic by craigwg

$
0
0

I am using a merge but I'm  having a newbie syntax error I think. Here is my statement:

MERGE INTO tables_dev.cust_wishlist AS tgt
USING stage.WL_WISHLIST AS src
ON tgt.cust_wishlist_id = src.id
AND tgt.cust_acct_id = src.customer_id
WHEN MATCHED THEN
UPDATE SET
name = cust_wishlist_name_txt,
cust_wishlist_typ_cd = cust_wishlist_typ_cd,
wl_private = prvt_ind,
is_default = dflt_ind,
ship_addr_id = ship_addr_id,
event_dt = event_dt,
create_date = create_dttm,
CURRENT_DATE = last_update_dttm,
'ETL_ADHOC_USER' = last_update_user

It's crashing on "CURRENT_DATE = last_update_dttm,". The error message is misleading. It says, "Syntax error, expected something like a name or unicode delimited identifier or a ROWID keyword between ',' and "CURRENT_DATE". 

it seems reasonable to me that an update in a merge should include the ability to insert a current date as a last_updated time stamp. BTW this syntax works fine in a regular update statement, but the merge is crashing. Help?

Craig Greenwood

Tags: 
Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>