PL/SQL (MOSC)

MOSC Banner

INSERT failure handling PL/SQL

edited Jan 21, 2014 2:42PM in PL/SQL (MOSC) 9 commentsAnswered ✓
 Hi guys
I have one procedure which inserts "some" records into a Oracle interface table (material transaction interface), and the coding is

Declare
l_record_count NUMBER := 0;
l_insert_exception EXCEPTION;
Begin

select COUNT(*) into l_record_count
from mtl_transactions_interface_xxx
        where organization_id = p_org_id
        and subinventory_code = p_subinventory_code
        and to_number(attribute10) = p_stock_take_id;

savepoint prior_interface_insert;

insert into mtl_transactions_interface
        select * from mtl_transactions_interface_xxx
        where organization_id = p_org_id
        and subinventory_code = p_subinventory_code
        and to_number(attribute10) = p_stock_take_id;

if NOT(sql%rowcount = l_record_count)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center