この更新文を記述してDB2のレコードを更新しました。内部結合のある列に複数のレコードが更新されるDB2
UPDATE schemaname.tablename
SET fillerinfo = myfillerinfo
FROM schemaname.tablename,schemaname.tablename1
WHERE ID = uid1
AND PID=uuplanid
AND ACCTNO=uacctno
ただし、AS400 DB2で実行している場合。私は500Kレコードを持っている上のように
Table1 | Table2
fillerinfo |myfillerinfo
-----------|-------------
A | b
c | D
E | f
:
は、私はこのようなデータを持っています。
その表示エラー:ステートメントを実行できません。
私はエラーを取得しています:https://oscarvalles.wordpress.com/2013/05/12/db2-update-with-inner-joins/
しかし、上記のリンクでは、この例では、単一のレコードを更新するために示している:
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.
だから私はそれができますかどうかを確認するには、このリンクを査読。
ジョインで列の複数のレコードを更新するにはどうすればよいですか?提案してください。
可能であれば、テーブル構造とサンプルデータのような詳細を追加 –