Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 80EB3475BC3 for ; Fri, 17 Jan 2003 01:00:27 -0500 (EST) Received: from babyruth.hotpop.com (babyruth.hotpop.com [204.57.55.14]) by postgresql.org (Postfix) with ESMTP id E747047592C for ; Fri, 17 Jan 2003 01:00:26 -0500 (EST) Received: from bonbon.net (kubrick.hotpop.com [204.57.55.16]) by babyruth.hotpop.com (Postfix) with SMTP id 6C62D210609 for ; Fri, 17 Jan 2003 05:59:31 +0000 (UTC) Received: from yudha (unknown [61.5.113.68]) by smtp-2.hotpop.com (Postfix) with SMTP id 586B61B8636 for ; Wed, 15 Jan 2003 09:05:02 +0000 (UTC) Message-ID: <023f01c2bc75$bdce13b0$ea00a8c0@yudha> From: "Yudha Setiawan" To: Subject: Do Something before Abort on Trigger ??? Date: Wed, 15 Jan 2003 16:08:40 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_023A_01C2BCB0.5EBA0330" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/186 X-Sequence-Number: 7028 This is a multi-part message in MIME format. ------=_NextPart_000_023A_01C2BCB0.5EBA0330 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Somebody gimme your hand plz. Using my previous Database I used to be like that; " ALTER TRIGGER tr_T_DtlPO ON dbo.T_DtlPO FOR UPDATE AS bla..bla..bla... IF @OldQty <> @NewQty BEGIN ROLLBACK INSERT INTO T_My_ListError(fc_code,fv_descript)=20 VALUES('12345','No Authority to Change Qty') END" So I'v already write the error code to table T_My_ListError before aborting= this session ---------------------------------------------------------------------------= -------------- And I Tried on Postgre like that; " create or replace function fn_tr_t_dtlpo returns trigger as' begin bla..bla...; if new.fn_qty !=3D old.fn_qty then=20 raise exception ''Error 12345''; insert into t_my_listerror(fc_code,fv_descript)=20 values(''12345'',''No Authority to Change Qty''); end if; end;' language 'plpgsql'; " But I Couldn't get any records at all on t_my_listerror. Even when put the = insert statement (insert into t_my_listerror...bla..bla) before raise exception. Some advice will be very helpfull to me. Thank's a lot and ... GOD Bless You All. ------=_NextPart_000_023A_01C2BCB0.5EBA0330 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Somebody gimme your hand plz.
 
Using my previous Database I used = to be=20 like that;
" ALTER TRIGGER tr_T_DtlPO&nb= sp;ON=20 dbo.T_DtlPO FOR UPDATE AS
  bla..bla..bla...
  IF @OldQty <> @N= ewQty=20 BEGIN
    =20 ROLLBACK
     INSE= RT=20 INTO T_My_ListError(fc_code,fv_descript)
           =    =20 VALUES('12345','No Authority to Change Qty')
  END"
So I'v already write the error cod= e to=20 table T_My_ListError before aborting this session
------------------------------------------------------------------= -----------------------
And I Tried on Postgre like=20 that;
" create or replace function fn_tr= _t_dtlpo=20 returns trigger as'
  begin
    =20 bla..bla...;
     if new.fn= _qty !=3D=20 old.fn_qty then
     &nbs= p; =20 raise exception ''Error 12345'';
     &nbs= p; =20 insert into t_my_listerror(fc_code,fv_descript)
           =      =20 values(''12345'',''No Authority to Change Qty'');
     end= =20 if;
  end;' language=20 'plpgsql';
"
But I Couldn't get any records at = all on=20 t_my_listerror. Even when put the insert statement
(insert into t_my_listerror...bla.= .bla)=20 before raise exception.
 
Some advice will be very helpfull = to me.=20 Thank's a lot and ...
GOD Bless You All.
 
------=_NextPart_000_023A_01C2BCB0.5EBA0330--