Log Transaction


Oracle PL/SQL Transactions Public New

Hard  

3min

Consider the following code:

CREATE OR REPLACE PROCEDURE log_transaction(log_message VARCHAR2,
                                            log_level NUMBER) AS
  PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
  INSERT INTO logs(log_text, log_level) VALUES(log_message, log_level);

  IF log_level = 0 THEN
    ROLLBACK WORK;
  ELSIF log_level <= 5 THEN
    COMMIT;
  END IF;
END;
/

Select all the statements that are correct when calling this function within another transaction.