Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:48:53+00:00 2026-05-30T04:48:53+00:00

I have following procedure: procedure mayFailProc() as begin insert into t1 (id, val) values

  • 0

I have following procedure:

procedure mayFailProc() as
begin
    insert into t1 (id, val) values (1, '123');
    insert into t1 (id, val) values (2, '123');
    insert into t1 (id, val) values (3, '123'); //fails, i.e. due to pk uniqueness error
end;

this exception thrown in mayFailProc is a normal thing and it is handled by its caller. So the transaction is not rolled back and execution continues as if there was no exception in mayFailProc. I wonder what will happen to first two successfully executed inserts? Will they be retained or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:48:54+00:00Added an answer on May 30, 2026 at 4:48 am

    See here for Oracle’s explanation. You can jump to the How Oracle Does Implicit Rollbacks section to start.

    Before executing an INSERT, UPDATE, or DELETE statement, Oracle marks
    an implicit savepoint (unavailable to you). If the statement fails,
    Oracle rolls back to the savepoint. Usually, just the failed SQL
    statement is rolled back, not the whole transaction. If the statement
    raises an unhandled exception, the host environment determines what is
    rolled back.

    More:

    You should explicitly commit or roll back every transaction. Whether
    you issue the commit or rollback in your PL/SQL program or from a
    client program depends on the application logic. If you do not commit
    or roll back a transaction explicitly, the client environment
    determines its final state.

    For example, in the SQL*Plus environment, if your PL/SQL block does
    not include a COMMIT or ROLLBACK statement, the final state of your
    transaction depends on what you do after running the block. If you
    execute a data definition, data control, or COMMIT statement or if you
    issue the EXIT, DISCONNECT, or QUIT command, Oracle commits the
    transaction. If you execute a ROLLBACK statement or abort the SQL*Plus
    session, Oracle rolls back the transaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following stored procedure ALTER PROCEDURE [dbo].Test AS BEGIN CREATE TABLE ##table
I have following procedure which is filling up null values in a column. The
I have the following procedure: CREATE PROCEDURE foo () SELECT * FROM fooBar INTO
I have the following SP: CREATE PROCEDURE [dbo].[sp_LockReader] AS BEGIN SET NOCOUNT ON; begin
I have the following merge procedure. How can I access values from merge statement
I have following stored procedure code when i execute it gives an error saying
I have the following stored procedure: proc_main:begin declare done tinyint unsigned default 0; declare
I have the following insert stored procedure: CREATE Procedure dbo.APPL_ServerEnvironmentInsert ( @ServerEnvironmentName varchar(50), @ServerEnvironmentDescription
I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) ,
We have the following simple Stored Procedure that runs as an overnight SQL server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.