question

garmada avatar image
garmada asked

You executed this command to create a temporary table: (inside) What is true about the rows inserted into the REPORT_WORK_AREA table during a transaction after commit?

Hello, i need answer to this question. Thanks a lot. You executed this command to create a temporary table: SQL> CREATE GLOBAL TEMPORARY TABLE report_work_area (startdate DATE, enddate DATE, class CHAR(20)) ON COMMIT PRESERVE ROWS; What is true about the rows inserted into the REPORT_WORK_AREA table during a transaction after commit?
tabletemporary-tabletemporary-tablesglobal-temporary-table
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
What database management system is this for? That's not T-SQL syntax, so we're not talking about SQL Server.
0 Likes 0 ·
KenJ avatar image KenJ commented ·
Sounds a bit like homework or an interview question. My first stop would probably be to check the documentation - http://docs.oracle.com/javadb/10.8.2.2/ref/rrefdeclaretemptable.html If that didn't work, I'd probably try looking on an internet search engine - https://duckduckgo.com/?q=ON+COMMIT+PRESERVE+ROWS+site%3Aoracle-base.com Where have you tried to find the answer, so far? I see a previous question on this site that give a great hint as to the answer in the comments - http://ask.sqlservercentral.com/questions/38083/global-temporary-tables.html
0 Likes 0 ·

1 Answer

·
Phil Factor avatar image
Phil Factor answered
In Oracle, data rows in a global temporary table will either be SESSION based, in which data survives a commit but not a disconnect/reconnect, or they can be TRANSACTION based, in which data disappears after a commit. If the table was created as being SESSION-based, with "on commit preserve rows", then data will remain until the end of the current session. If it was created as being TRANSACTION- based with the "on commit delete rows" then it will remain until the next commit or rollback.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.