SET ECHO OFF
SET AUTOCOMMIT OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET TERMOUT OFF
SET TRIMSPOOL OFF
SET SHOW OFF
DEFINE UOW = &1

SET TERMOUT ON
BEGIN
   IF UPPER('&UOW') = 'COMMIT' THEN
      COMMIT;
      DBMS_OUTPUT.PUT_LINE(' ');
      DBMS_OUTPUT.PUT_LINE('COMMIT ISSUED!');
      DBMS_OUTPUT.PUT_LINE(' ');
   ELSIF UPPER('&UOW') = 'NONE' THEN
      DBMS_OUTPUT.PUT_LINE(' ');
      DBMS_OUTPUT.PUT_LINE('NO COMMIT OR ROLLBACK ISSUED because NONE was requested.');
      DBMS_OUTPUT.PUT_LINE(' ');
   ELSE
      ROLLBACK;
      DBMS_OUTPUT.PUT_LINE(' ');
      DBMS_OUTPUT.PUT_LINE('ROLLBACK ISSUED!');
      DBMS_OUTPUT.PUT_LINE(' ');
   END IF;
END;
/
SET TERMOUT OFF

-- Reset environment parameters
UNDEFINE 1
UNDEFINE UOW
SET FEEDBACK ON
SET VERIFY ON
SET TERMOUT ON

