Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2004
    Posts
    54

    Unanswered: roll back question

    i have a question, i am inserting data to the database
    however let's just say that after a succesul inserting
    of data i want to undo the operations, like the inserting
    of data never happened, what can i do... transaction
    roll back doesn't seem to work.

  2. #2
    Join Date
    Dec 2004
    Posts
    19
    As a first cut analysis

    1. use truncate for complete deletion of records, while maintaining th e structure
    2. use delete for deletion based on a crieteria(u can additionally insert a serial number and then delete based on the serial number)

    Eg.

    Insert into mytable values(1,'sada');

    Insert into mytable values(2,'norman');

    now

    delete from mytable where serial_no = 2;


    Idea: If the data is too large you can insert it with SQLLoader



    Quote Originally Posted by yoanna
    i have a question, i am inserting data to the database
    however let's just say that after a succesul inserting
    of data i want to undo the operations, like the inserting
    of data never happened, what can i do... transaction
    roll back doesn't seem to work.

  3. #3
    Join Date
    Nov 2004
    Posts
    3
    You must ensure that there is no DDL or DCL commands between insert and rollback statements.
    Because DDL or DCL will auto-complete commit in Oracle, so any data input by un-commit insert statements will permanently exist in DB

  4. #4
    Join Date
    Oct 2004
    Posts
    54
    thanks for all your help, i actually found the error why the rollback
    statements didn't work..... thanks again =)

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Could you explain WHY did it not work, please? Because just saying that you've found it out doesn't help much to the others who might encounter similar problems.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •