Hi Birgitta,
thanks for your answer, I didn't explain my problem well.
until now I have a programs than read a logical file (with some select and omit). Prepare the information to be returned to the caller and update the record.
Now in add to this file I have to read an extension of this file (for 98% there will be nothing), so doing it with traditional rpg after read I make a chain to the second table.
My wish is to read the first and the second table together (with a join) and than prepare the information to be returned to the caller and update only the first table, the second table is only in input.
If you want I can write a sample.
Thank you
------------------------------
Paolo Salvatore
------------------------------
Original Message:
Sent: Tue February 27, 2024 03:40 AM
From: Birgitta Hauser
Subject: Update data from result set
- Why not just executing 2 independent Update Statements?
- If you really want to update a JOINED View, you could create an INSTEAD OF TRIGGER which then performs the update into the first and another update into the second table.
------------------------------
Birgitta Hauser
Database and Software Engineer
Selfemployed - Modernization-Education-Consulting on IBM i
Kaufering
+49 170 5269964
Original Message:
Sent: Tue February 27, 2024 02:41 AM
From: Paolo Salvatore
Subject: Update data from result set
Hi, I have to update some fields of a result set, like this example:
Updating data as it is retrieved from a table
| Ibm | remove preview |
| | Updating data as it is retrieved from a table | | You can update rows of data as you retrieve them by using a cursor. | | View this on Ibm > |
|
|
but I need to join two tables, I need to update only some fields from the first table, so I create a view to join the two tables, but making a join the view become read only.
Is there any tricks to select from a join and update only some fields from first table?
------------------------------
Paolo Salvatore
------------------------------
#RPG