PL/SQL (MOSC)

MOSC Banner

Solve a Mutating trigger

edited Dec 23, 2018 4:01AM in PL/SQL (MOSC) 14 commentsAnswered

How can i solve this mutating trigger? the option i have seen through google is with the use of a compound trigger but i have never used them before some assistance will be appreciated. Below is the trigger

CREATE OR REPLACE TRIGGER EXPORT_DATA

AFTER INSERT ON EMPLOYEES

FOR EACH ROW

WHEN (NEW.salary > 3000)

DECLARE

  CURSOR emp_data IS

  SELECT employee_id, first_name, last_name, salary, job_id, department_id

   FROM employees;

v_file UTL_FILE.FILE_TYPE;

BEGIN

  v_file := UTL_FILE.FOPEN (location => 'DUMP_DIR',

                                              filename => 'emp_details.csv',

                                              open_mode => 'w',

                                              max_linesize => 32767);

  FOR cur_rec IN c_data LOOP

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