I have written this update statement to update records in DB2.
UPDATE schemaname.tablename
SET fillerinfo = myfillerinfo
FROM schemaname.tablename,schemaname.tablename1
WHERE ID = uid1
AND PID=uuplanid
AND ACCTNO=uacctno
However, when running on AS400 DB2.
I have Data like this:
Table1 | Table2
fillerinfo |myfillerinfo
-----------|-------------
A | b
c | D
E | f
Like above i have 500K records.
Its showing error: Statement can not be executed.
I'm getting error:
Keyword FROM not expected. Valid tokens: USE SKIP WAIT WITH WHERE. Cause . . . . . : The keyword FROM was not expected here. A syntax error was detected at keyword FROM. The partial list of valid tokens is USE SKIP WAIT WITH WHERE. This list assumes that the statement is correct up to the unexpected keyword. The error may be earlier in the statement but the syntax of the statement seems to be valid up to this point. Recovery . . . : Examine the SQL statement in the area of the specified keyword. A colon or SQL delimiter may be missing. SQL requires reserved words to be delimited when they are used as a name. Correct the SQL statement and try the request again.
So I refereed this link to see if it helps: https://oscarvalles.wordpress.com/2013/05/12/db2-update-with-inner-joins/
But, this example in the above link is showing to update single records.
How can I update multiple records in a column with join? Please suggest.