lowLatency
lowLatency

Reputation: 5664

Updating temporary table data in Oracle

If I have a temp table(10 fields) and it is updated using a Stored proc(single update statement for single column).

Is commit required to get the temp table updated? Will things without commit work fine?

Upvotes: 0

Views: 1001

Answers (2)

Alex Poole
Alex Poole

Reputation: 191425

If it is a real temporary table, data in it is only ever visible to your session, even if you commit, never to anyone else. If the on commit clause is preserve rows then committing makes no difference even to you, but if it's delete rows then you'd lose the data after you commit, even in your session.

If it isn't a real temporary table then the data in it will only be visible to your session, until you commit. Whatever called your procedure will (normally) be in the same session, so will see the data changes, and usually the caller will decide whether to commit or rollback - it's generally not a good idea to do that inside a procedure.

Upvotes: 3

OraNob
OraNob

Reputation: 694

Put it this way - If you do not commit - only your session will see the changes at any point in time.

Upvotes: -1

Related Questions