Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Nested transactions?

Re: Nested transactions?

From: Paul Zola <pzola_at_us.oracle.com>
Date: 1996/12/24
Message-ID: <59p9ef$80a@inet-nntp-gw-1.us.oracle.com>#1/1

} Mr. Jeremy Bettis <bettis_at_inetnebr.com> wrote in article
} <59otbf$8qv_at_falcon.inetnebr.com>...

} > Does Oracle have nested transactions? i.e. can I do something like this:
} >
} > start transaction
} >
} > insert foo...
} >
} > start transaction
} >
} > insert bar...
} >
} > rollback
} >
} > insert baz...
} >
} > commit
} >
} > and have foo and baz done, but not bar ? Other databases have this, yet
 I
} > can't see how to do it here. I am using OCI to access the database. But
 an
} > example in PL/SQL would be fine too.

You can do what you want using the SAVEPOINT command. (I've never heard it called "nested transactions" before, BTW.)

For example:

    insert foo ...
    SAVEPOINT XX1;
    insert bar ....
    ROLLBACK TO SAVEPOINT XX1;
    insert baz ....
    COMMIT WORK; will insert foo and baz, but not bar.


Paul Zola                                                 Technical Specialist
World-Wide Technical Support                                 Development Tools
==============================================================================
Computers possess the truly profound stupidity of the inanimate. - B. Sterling
Disclaimer: 	Opinions and statements are mine, and do not necessarily
		reflect the opinions of Oracle Corporation.
Received on Tue Dec 24 1996 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US