----------------------------------------------------------------------- WORKLOG TASK -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- TASK...........: DELETE with result set CREATION DATE..: Thu, 30 Jun 2011, 14:13 SUPERVISOR.....: IMPLEMENTOR....: COPIES TO......: CATEGORY.......: Server-RawIdeaBin TASK ID........: 205 (http://askmonty.org/worklog/?tid=205) VERSION........: WorkLog-4.0 STATUS.........: Un-Assigned PRIORITY.......: 60 WORKED HOURS...: 0 ESTIMATE.......: 40 (hours remain) ORIG. ESTIMATE.: 40 PROGRESS NOTES: DESCRIPTION: Add a DELETE operations that returns a result set of the deleted rows to the client. Suggested syntax: The DB2 syntax: DELETE from (SELECT column_list from single_table WHERE ... ORDER BY) another option would be DELETE FROM table_name WHERE ... [LIMIT #]] SELECT expression_list but I think that the first syntax is more clear. It's also easier to expand it to handle multiple tables. Oracle supports the following syntax: DELETE <table or expression> <alias> WHERE <where_clause> RETURNING <exprs> INTO <data_items> but this is not useful as it can only be used to record single row deletes. ESTIMATED WORK TIME ESTIMATED COMPLETION DATE ----------------------------------------------------------------------- WorkLog (v4.0.0)