X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id ACC1C475458 for ; Wed, 19 Feb 2003 08:20:19 -0500 (EST) Received: from babyruth.hotpop.com (babyruth.hotpop.com [204.57.55.14]) by postgresql.org (Postfix) with ESMTP id 0CD77475425 for ; Wed, 19 Feb 2003 08:20:19 -0500 (EST) Received: from bonbon.net (kubrick.hotpop.com [204.57.55.16]) by babyruth.hotpop.com (Postfix) with SMTP id 9E7C021235B for ; Wed, 19 Feb 2003 13:20:08 +0000 (UTC) Received: from yudha (unknown [61.5.113.36]) by smtp-2.hotpop.com (Postfix) with SMTP id A60971B889D for ; Wed, 19 Feb 2003 13:20:00 +0000 (UTC) Message-ID: <01c801c2d81a$414f4aa0$ea00a8c0@yudha> From: "Yudha Setiawan" To: Subject: How to avoid the Mutating Triggers ?? Date: Wed, 19 Feb 2003 19:59:22 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01C0_01C2D851.6567D790" 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: 200302/307 X-Sequence-Number: 7505 This is a multi-part message in MIME format. ------=_NextPart_000_01C0_01C2D851.6567D790 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Master, I've some problem with this situation. It's hard to explain what kind of problem is, but i try to tell you=20 with my limitation on english. How do I "recalculate" one of my field, if i updated one of the record that's have position in the middle of all record. Here my Ilustration is; ---------------------------------------- Poin-|FdDate | Code| IN |OUT| Qty | ter. |---------------------------------- 1 |01/01/2003 | 001 | 5 | 0 | 5 |=20 2 |01/02/2003 | 001 | 3 | 0 | 8 | 3 |01/03/2003 | 001 | 0 | 1 | 7 | 4 |01/06/2003 | 001 | 100 | 0 | 117 | 5 |00107/2003 | 001 | 0 | 1 | 118 | 6 |00108/2003 | 001 | 0 | 1 | 119 | 7 |00109/2003 | 001 | 0 | 1 | 120 | ---------------------------------------- And what i want is, update the record=20 on Pointer no 4. on "IN" is changed from 100 to 10 And Qty is Automaticly change from 117 to 17. like this; ---------------------------------------- Poin-|FdDate | Code| IN |OUT| Qty | ter. |---------------------------------- 4 |01/06/2003 | 001 | 10 | 0 | 17 | ---------------------------------------- Following with record below it, and become=20 like this; ---------------------------------------- Poin-|FdDate | Code| IN |OUT| Qty | ter. |---------------------------------- 5 |00107/2003 | 001 | 0 | 1 | 18 | 6 |00108/2003 | 001 | 0 | 1 | 19 | 7 |00109/2003 | 001 | 0 | 1 | 20 | ---------------------------------------- I've been trying using cursor inside of my trigger, It didn't work and it's=20 "mutating". i thought my trigger is=20 working recursive. It's very Urgent=20 for me. I've been migrating Database=20 from Ms-SQL, so far so great, till=20 this Problem I've been spending my=20 3 Days with No-Result.=20 It's time to Give-up.=20 So gimme your hand please...??? Thank's to you and,=20 GOD Bless You All. Yudha Setiawan. VoIP=20 No. : 628899911223344 ------=_NextPart_000_01C0_01C2D851.6567D790 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Master,
I've some problem with this=20 situation.
It's hard to explain what kind=20 of
problem is, but i try to tell you= =20
with my limitation on=20 english.
 
How do I "recalculate" one of
my field, if i updated one of
the record that's have=20 position
in the middle of all record.
Here my Ilustration is;
----------------------------------------
Poin-|FdDate   &nbs= p; |=20 Code| IN  |OUT| Qty |
ter.=20 |----------------------------------
1    |01/01/2003 | = 001 |=20=20 5  | 0 |   5 |
2    |01/02/2003 | = 001 |=20=20 3  | 0 |   8 |
3    |01/03/2003 | = 001 |=20=20 0  | 1 |   7 |
4    |01/06/2003 | = 001 | 100=20 | 0 | 117 |
5    |00107/2003 | = 001 |=20=20 0  | 1 | 118 |
6    |00108/2003 | = 001 |=20=20 0  | 1 | 119 |
7    |00109/2003 | = 001 |=20=20 0  | 1 | 120 |
----------------------------------------
And what i want is, update the record
on Pointer no 4. on "IN" is changed from
100 to 10 And Qty is Automaticly change
from 117 to 17. like this;
----------------------------------------
Poin-|FdDate   &nbs= p; |=20 Code| IN  |OUT| Qty |
ter.=20 |----------------------------------
4    |01/06/2003 | = 001 | 10=20=20 | 0 |  17 |
----------------------------------------
Following with record below it, and become
like this;
----------------------------------------
Poin-|FdDate   &nbs= p; |=20 Code| IN  |OUT| Qty |
ter.=20 |----------------------------------
5    |00107/2003 | = 001 |=20 0  | 1 |  18 |
6    |00108/2003 | = 001 |=20 0  | 1 |  19 |
7    |00109/2003 | = 001 |=20 0  | 1 |  20 |
----------------------------------------
 
I've been trying using cursor insi= de=20 of
my trigger, It didn't work and it'= s=20
"mutating". i thought my trigger i= s=20
working recursive. It's very Urgen= t=20
for me. I've been migrating Databa= se=20
from Ms-SQL, so far so great, till
this Problem I've been spending=20 my
3 Days with No-Result.
It's time to Give-up.
So gimme your hand please...???
 
Thank's to you and,
GOD Bless You All.
 
Yudha Setiawan.
VoIP=20
    No.        :=20 628899911223344
------=_NextPart_000_01C0_01C2D851.6567D790--