I am currently trying to do an

```
SELECT DISTINCT * FROM FINAL TABLE 
(UPDATE mainTable SET value = 'N' WHERE value2 = 'Y')

```

However, the version of DB2 I have does not appear to support this

```
SQL Error [42601]: [SQL0199] Keyword UPDATE not expected. Valid tokens: INSERT.

```

Is there any alternative to this in DB2 that could be return a desired result? Where in one query we can Update and Return the result?

EDIT -
The Select statement is supposed to return the values that are to begin processing by a server application. When this happens, a column will be updated to indicate that the Processing of this row has begun. A later command will update the row again when it is completed.

```
ORIGINAL DATA
ROW ID | COLUMN TWO | PROCESSING FLAG
-------------------------------------------
1      | TASK 1     |      N
2      | TASK 2     |      N
3      | TASK 3     |      N
4      | TASK 4     |      N

```

After Optimistic Select/Update Query

```
Data Table returned as:
ROW ID | COLUMN TWO | PROCESSING FLAG
-------------------------------------------
1      | TASK 1     |      Y
2      | TASK 2     |      Y
3      | TASK 3     |      Y
4      | TASK 4     |      Y

```

This is being called by a .NET Application, so this would be converted into a List of the Table Object.