Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E9F0E475F2F for ; Thu, 16 Jan 2003 20:39:58 -0500 (EST) Received: from rizzo.jerky.net (rizzo.jerky.net [204.57.55.99]) by postgresql.org (Postfix) with ESMTP id 4B2D7475BC3 for ; Thu, 16 Jan 2003 20:39:58 -0500 (EST) Received: from bonbon.net (kubrick.hotpop.com [204.57.55.16]) by rizzo.jerky.net (Postfix) with SMTP id 2A4CD30CED for ; Fri, 17 Jan 2003 01:39:30 +0000 (UTC) Received: from yudha (unknown [61.5.117.26]) by smtp-2.hotpop.com (Postfix) with SMTP id A43D71B8DC4 for ; Fri, 17 Jan 2003 01:36:49 +0000 (UTC) Message-ID: <005c01c2bdc9$77b8c870$ea00a8c0@yudha> From: "Yudha Setiawan" To: Subject: Do Something before Abort on Trigger ??? Date: Fri, 17 Jan 2003 08:23:44 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0015_01C2BE01.C02E4DE0" 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/185 X-Sequence-Number: 7027 This is a multi-part message in MIME format. ------=_NextPart_000_0015_01C2BE01.C02E4DE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Somebody Help Me..... 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_0015_01C2BE01.C02E4DE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Somebody Help Me.....
 
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_0015_01C2BE01.C02E4DE0--