I want to add a security on a sensitive table when I delete lines with an SQL request on a DB2 table.
I want to mimic the way MySQL allows you to limit the numbers o
DELETE
FROM Bibl/File
WHERE RRN(File) = (
SELECT min(RRN(File))
FROM Bibl/File
WHERE Fld1 = 'xx'
)
The RRN function is to AS400/iSeries/PowerSystem alone. In other environments there are other functions for the relative record number.
This makes it possible to erase a record of several identical even without UNIQUE key. It can also be used to update with minor changes.
works like the LIMIT but with DELETE and / or UPDATE.
It only works on SQL DB2 in other settings should be changed by RRN function to return the column number