Update a table with the field of another table (DB2)

0

I need to update a table with the field of another table for data after April 5.

I'm using this query, but it fails because the date can not be put there.

MERGE INTO a
USING b
ON b.cruceA=a.cruceB
WHEN MATCHED AND FECHA_CARGA>='2017-04-05'
THEN UPDATE SET a.campo1=b.campo2||a.campo3;

How can I specify the date correctly?

    
asked by jordisec 29.06.2017 в 15:46
source

1 answer

1

You must convert the date to date:

MERGE INTO a
USING b
ON b.cruceA=a.cruceB
WHEN MATCHED AND FECHA_CARGA>=DATE('2017-04-05')
THEN UPDATE SET a.campo1=b.campo2||a.campo3;
    
answered by 29.06.2017 / 16:37
source