0

以前の回答を確認して、Netbeans 8.1 の 2 つのデータベース間でテーブルを参照するための疑似外部キーを作成しました。これは私が思いついたコードです、

DELIMITER //

CREATE OR REPLACE TRIGGER conf_track_FK
AFTER INSERT OR UPDATE on S26994437.track@FIT5148B
FOR EACH ROW
BEGIN
    IF EXISTS(select * from inserted I where not exists (select * from
    S1234567.conference@FIT5148A A where I.conf_id=A.conf_id))
    RAISE_APPLICATION_ERROR(-20001,'Violation of pseudo-foreign key.');
    ROLLBACK;
    END IF;
END;

/

ただし、次のエラーが発生します。

PLS-00103: Encountered the symbol ";" when expecting one of the following:
   ) with and or group having intersect minus start union where
   connect

PLS-00103: Encountered the symbol "ROLLBACK" when expecting one of the following:
   := . ( % ;
The symbol ":=" was substituted for "ROLLBACK" to continue.

PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   end not pragma final instantiable order overriding static
   member constructor map
4

2 に答える 2