Example:

for rec in (query1) loop select * from query1; end loop; 

In order not to write query1 twice and not to load the database, can I save the results of the query somewhere and then use them? Something like a cursor, but so that you can make a selection of it ...

    1 answer 1

    You can use temporary tables:

     create global temporary table temp_table_transaction on commit delete rows as select * from dummy where 1=0 

    link

    • @ HashCode, the link in the answer is buggy, it did not work out. Decorated like right. - Sh4dow
    • Removed battered. Added a link to another resource. - jmu
    • @jmu, this is a known issue with links. See. Markup does not work for some links . - angry
    • we will know thanks. I only dropped the previous link without spaces, but there were many ":" signs. - jmu