Justin Molenaur wrote:
Patrick, from what I know, temporary tables are just that - temporary. You can insert into them, but as soon as the stored procedure session ends, the contents are gone. An update would work only within the context of the stored procedure.
That's nearly correct - the lifetime of temporary tables looks like this:
global temporary table | local temporary table | |
---|---|---|
structure | persisted - table structure will be available after the end of the creating transaction | not persisted - table structure is gone after the end of the transaction |
data | data is private to the session that created it and will be deleted after the end of the transaction (COMMIT or ROLLBACK) | data is private to the session that created it and will be deleted after the end of the transaction (COMMIT or ROLLBACK) |
All this and the list of supported operations on the different types of temp. tables can be found here CREATE TABLE - SQL Reference - SAP Library.
- Lars