ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Final Tabel in a update

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Final Tabel in a update

    I got this update

    update FILE1 set FLD100 = substring(FLD100, 1 , 42) ||
    COALESCE( (SELECT max(DATE) FROM FILE2 WHERE
    FLD10=10) , (SELECT max(DATE) FROM FILE3 WHERE
    FLD20=10)) , '20240426' ) where FLD30 = 10

    I want this intrucion to return the value of the update, the FLD100

    I try with the select from final table, i go the error: Keyword UPDATE not expected. Valid tokens: INSERT

    Any thoughts?

  • #2
    AFAIK Final Table can only be used in composition with an INSERT Statement.
    I'd suggest to determine the value before the update, save it in a variable and then use this variable in the UPDATE statement.

    Comment

    Working...
    X