2016-04-29 91 views
0

我已經創建了一個使用oracle sql developer調用一個過程的觸發器。下面是觸發代碼:沒有更多數據從套接字讀取(Oracle SQL Developer)

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; 
/

現在,程序寫在這裏:

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; 
/

當我試圖通過這個修改注表:

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

我得到錯誤:

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 
+0

MoS上有許多已發佈的錯誤和一些對未發佈的錯誤的引用,因此您可能需要提高SR以從Oracle獲得指導。您可以在重新編譯包和觸發器之前嘗試禁用PL/Scope,但不確定這是否有幫助。而一些錯誤表明他們可能導致腐敗。值得檢查警報日誌和跟蹤文件,並評估影響。 –

+0

當您發生ora 600錯誤時,請始終輸入一個SR。有可能是其他人有類似的問題,他們可以爲你解決它或想出一個解決方法。另外,你是否檢查會話跟蹤文件? –

回答

0

這是Ora-600你笑如果你想深入探究爲什麼會出現在你的案例中,也許你應該打開SR。

此外,在引用創建觸發器的表「note」的代碼中,這可能會導致表變異,因此請考慮更改代碼邏輯的選項。

在我的理解中,你需要聲明級觸發器,而不是行級觸發器?

0

ORACLE server session terminated by fatal error

試試這個,對相同的「主題」讓我們說:)而設置的東西如以前只是解決了我的問題,同樣的問題。祝你好運!

+0

我希望我的回答不會太遲,但即使已經很晚了,也許你會試一試,我很好奇它是否會奏效。另一個我認識的人嘗試了這個ON MY OWN SQL SCRIPT ....並且仍然沒有解決這個問題:))) – student0495

相關問題