Re: Trigger - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Trigger
Date
Msg-id 95C2937F-1036-4691-B682-9052C1D2B621@gmail.com
Whole thread Raw
In response to Re: Trigger  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Trigger  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
> On 25 Feb 2020, at 17:53, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
> On 2/25/20 12:01 AM, Sonam Sharma wrote:
>> I have a trigger, like many other triggers that fire after
>> update and checks a field of the OLD set. For some reason this trigger throw this error:
>> ERROR: record "old" has no field "ivo_sts_cd" CONTEXT: SQL statement
>
>> if exc_count = 0 then
>> UPDATE pps.T8071_CAI_IVO_HDR SET IVO_STS_CD = 1 where T616_VBU_NBR=old.T616_VBU_NBR and
T617_FNC_TYP_CD=old.T617_FNC_TYP_CDand 
>> T8071_CAI_IVO_ID=old.T8071_CAI_IVO_ID and T8071_ADD_DM= old. T8071_ADD_DM and old.ivo_sts_cd != 10 and
old.ivo_sts_cd!= 3; 
>
> Realized I went through the above to quickly. I do not see a SET, nor am I clear what table you are trying to UPDATE.

I’m pretty sure that if the OP were to format their query in a more readable and consistent way, they would spot their
errorpretty quickly. It’s a simple typo. 

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.




pgsql-general by date:

Previous
From: Justin
Date:
Subject: Re: Connections dropping while using Postgres backend DB with Ejabberd
Next
From: Adrian Klaver
Date:
Subject: Re: Trigger