(Contents)(Previous)(Next)

Keeping Result Sets

If a user wants to reuse a result table in other queries, he must name it and specify FOR REUSE for it. Then the table can be addressed within a transaction by this name at any time if it has not been explicitly deleted or another SELECT specifying a result table with the same name has not been performed. When leaving the session, the result table is automatically deleted.

SELECT report1 (title, firstname, name)

FROM customer

WHERE city = 'New York'

FOR REUSE

SELECT title, name

FROM report1


(Contents)(Previous)(Next)