0
votes

I have the following query I need to run on my production data, but I would like to output the id column so that I have a record of the updated rows. In MS SQL Server I can use OUTPUT but I can't find anything similar in the documentation.

UPDATE someTable as st
SET st.InActive = 1
WHERE st.ID IN (
        SELECT a.ID
        FROM someTable a
        natural join otherTable b
        WHERE b.EffectiveDate < '2016-09-15'
        ORDER BY a.ID Desc
)
1
By output you mean write to screen in some way? - Ben
Yes, much like SELECT would do. - THE JOATMON

1 Answers

0
votes

Looks like you looking for something like RETURNING clause in PostgreSQL. Unfortunately InterSystems Caché does not have such functionality or similar.