|
Alternative that always works no matter how many raise exceptions there are:
Create a (perlu) function that opens a second connection to your database and does the insert into m_proba.
Since this is a seperate connection, it's also a seperate transaction and thus not rolled back by your "main" transaction.
>>> "Michal Kedziora" <michalkd(at)o2(dot)pl> 2007-07-29 13:33 >>> Hi, Marcin
I'm not familiar with PREPARE TRANSACTION maby it could be done in that way.
But, you can use a EXCEPTION clause, and there put your insert.
IF EXISTS (SELECT 1 FROM g.m_lista WHERE idf = NEW.id) THEN
RAISE EXCEPTION 'CENY NIE SPELNIAJA WARUNKOW! %', rtrim(bledne); END IF; EXCEPTION
when RAISE_EXCEPTION then INSERT INTO g.m_proba VALUES (1,2); END; It will work corect if you have only one RAISE EXCEPTION,becouse RAISE_EXCEPTION concern every exception called by RAISE command.
I hope that will help.
|