A temporary table holds data that exists only for the duration of a transaction or session.
Data in a temporary table is private to the session. Each session can only see and modify its own data.
checkpoint certification malaysia
You can create either a global temporary table or a private temporary table. The following table shows the essential differences between them.
Table 2-5 Temporary Table Characteristics
| Characteristic | Global | Private |
|---|---|---|
| Naming rules | Same as for permanent tables | Must be prefixed with ORA$PTT_ |
| Visibility of table definition | All sessions | Only the session that created the table |
| Storage of table definition | Disk | Memory only |
| Types | Transaction-specific (ON COMMIT DELETE ROWS) or session-specific (ON COMMIT PRESERVE ROWS) | Transaction-specific (ON COMMIT DROP DEFINITION) or session-specific (ON COMMIT PRESERVE DEFINITION) |
A third type of temporary table, known as a cursor-duration temporary table, is created by the database automatically for certain types of queries.
Leave a Reply