Wed 31 Dec 2008

Sample Code Oracle stored procedure - In this simple implementation, call commit at the end of work done, and Rollback if any exception occur.

 

PROCEDURE SAVE_TWO_THINGS(
IN_THING_ONE IN VARCHAR2,
IN_THING_TWO IN VARCHAR2)
IS

BEGIN

INSERT INTO TABLEONE
(ACTIVE, THING_DESC)
VALUES
('Y', IN_THING_ONE);


INSERT INTO TABLETWO
(ACTIVE, THING_DESC)
VALUES
('N', IN_THING_TWO);

COMMIT;

EXCEPTION WHEN OTHERS THEN 
ROLLBACK;
END;

Comments here


Add Comment Post comment

 
 
 
   Country flag

Loading

Captcha





Ads