1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

example for exception for this transaction

Discussion in 'General' started by monkey, Apr 23, 2014.

  1. monkey

    monkey Long Term Member

    Messages:
    156
    Likes Received:
    0
    Trophy Points:
    230
    Dear Al!
    Hello, please, be friends, I am ending my first week dealing with transactions and triggers, and am trying this transaction to show me the error:

    Code (Text):

    begin
    savepoint sp1;
    insert into m values(5,'ee', 'EEE');
    COMMIT;
    EXCEPTION
    WHEN idm>4 THEN
    ROLLBACK TO my_point;
    raise_application_error(-20100, SQLERRM);
    END;
    It IS showing error, but such one meaning the transaction is not ok.
    I want the oracle to show errro if I try to add more than 4 rows
    Please, any ideas are welcome!

    P.s, I tried with:
    Code (Text):


    begin
    savepoint sp1;
    insert into m values(5,'ee', 'EEE');
    UNTIL idm>4
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK TO my_point;
    raise_application_error(-20100, SQLERRM);
    END;
    but just got error ora 06550
    Please!
    many thanks!