The ability to return the modified/deleted/inserted rows from a DML statement as a regular result set

SQL Workbench/J console interface started.
Enter 'exit' to quit.
Enter 'WbHelp' for a list of SQL Workbench/J specific commands
Config directory: C:\Projects\sqlworkbench\conf

SQL> wbconnect Postgres;
Connection to "User=thomas, Schema=public, URL=jdbc:postgresql://localhost/postgres" successful

thomas@postgres/public> delete from person where id = 42 returning *;
---- person
id | firstname | lastname
---+-----------+---------
42 | Arthur    | Dent

(1 Row)
DELETE FROM person successful
thomas@postgres/public> update person set lastname = 'Beeblebrox' where id = 43 returning *;
id | firstname | lastname
---+-----------+-----------
43 | Zaphod    | Beeblebrox

(1 Row)
UPDATE person successful

thomas@postgres/public> insert into person (firstname, lastname) values ('Han', 'Solo') returning *;
id | firstname | lastname
---+-----------+---------
81 | Han       | Solo

(1 Row)
INSERT INTO person successful
thomas@postgres/public>

Back to the SQL Feature Comparison