Reputation: 5664
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
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
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