0
votes

I have created one trigger that calls one procedure, using oracle sql developer. Here is the code for trigger:

CREATE OR REPLACE TRIGGER noteTrigger
  BEFORE
    INSERT OR
    UPDATE OF valoare OR
    DELETE
  ON note
BEGIN
  CASE
    WHEN INSERTING THEN
      DBMS_OUTPUT.PUT_LINE('Inserting');
      updateBursa();
    WHEN UPDATING('valoare') THEN
      DBMS_OUTPUT.PUT_LINE('Updating valoare');
      updateBursa();
    WHEN DELETING THEN
      DBMS_OUTPUT.PUT_LINE('Deleting');
      updateBursa();
  END CASE;
END;
/

Now, the procedure is written here:

  CREATE OR REPLACE PROCEDURE updateBursa IS
v_countBursieri NUMBER := 0;
BEGIN
  UPDATE STUDENTI SET bursa = null;
  FOR v_i IN (SELECT nr_matricol from studenti natural join note group by nr_matricol having avg(valoare) = 
          (select max(avg(valoare)) from studenti natural join note group by nr_matricol)) LOOP
          v_countBursieri := v_countBursieri + 1;
  END LOOP;
  FOR v_i IN (SELECT nr_matricol from studenti natural join note group by nr_matricol having avg(valoare) = 
          (select max(avg(valoare)) from studenti natural join note group by nr_matricol)) LOOP

          UPDATE STUDENTI SET bursa = 1000/v_countBursieri where nr_matricol = v_i.nr_matricol;
  END LOOP; 

END;
/

And when I try to modify note table by this:

INSERT INTO note VALUES ('111', '25',  5, TO_DATE('20/06/2015', 'dd/mm/yyyy'));

I get error:

Error report -
ORA-00603: ORACLE server session terminated by fatal error
ORA-00600: internal error code, arguments: [kqlidchg0], [], [], [], [], [], [], [], [], [], [], []
ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_PLSCOPE_SIG_IDENTIFIER$) violated
00603. 00000 -  "ORACLE server session terminated by fatal error"
*Cause:    An Oracle server session was in an unrecoverable state.
*Action:   Log in to Oracle again so a new server session will be created
           automatically.  Examine the session trace file for more
           information.

Error report -
SQL Error: No more data to read from socket
2
There are a number of published bugs and some references to unpublished bugs on MoS, so you might need to raise an SR to get guidance from Oracle. You could try disabling PL/Scope before recompiling the package and trigger, but not sure if that will help. And some of the bugs suggest they can lead to corruption. It's worth checking the alert log and trace files, and assessing the impact. - Alex Poole
When you get an ora 600 error, always enter an SR. The chances are good someone else had a similar problem and they can either fix it for you or come up with a workaround. Also, did you check in the session trace file? - T Gray

2 Answers

0
votes

This is Ora-600 you should deeply explore reasons why is raised in your case, maybe you should open SR.

also, in the code you are referencing the table "note" on which you are creating a trigger, which could lead to mutating table, so consider the option of changing your code logic.

In my understanding, you need statement level trigger, not row level trigger?

0
votes

ORACLE server session terminated by fatal error

Try this, had the same problem on the same "topic" let's say :) And setting things as shown previously just solved my problem. Good luck!