2008-02-28

RETURNING in DELETE statement

Today I found out that we can use the RETURNING clause also in a DELETE statement (not only in an INSERT or UPDATE statement).

DELETE <table or expression> <alias>
WHERE <where_clause>
RETURNING <exprs> INTO <data_items>;

As with the others DML statement types the RETURNING clause will to return the rows affected by the statement and can only be used with single tables, regular views based on a single table and materialized views.

It's a feature that I never needed but its very interesting.

No comments:

Post a Comment

Os comentários são moderados.
The comments are moderated.