Using COMMIT With the WRITE Clause
DROP TABLE accounts CASCADE CONSTRAINTS PURGE;
CREATE TABLE accounts (
account_id NUMBER(6),
balance NUMBER(10,2));
INSERT INTO accounts
VALUES (7715,
6350.00);
INSERT INTO accounts
VALUES (7720,
5100.50);
DECLARE
transfer NUMBER(8,2) := 250;
BEGIN
UPDATE accounts
SET balance = balance - transfer
WHERE account_id = 7715;
UPDATE accounts
SET balance = balance + transfer
WHERE account_id = 7720;
COMMIT COMMENT 'Transfer From 7715 to 7720' WRITE IMMEDIATE NOWAIT;
END;
/
0 comments:
Post a Comment