pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <haramrae@gmail.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Sonam Sharma <sonams1209@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Trigger
Date: Tue, 25 Feb 2020 18:08:27 +0100
Message-ID: <95C2937F-1036-4691-B682-9052C1D2B621@gmail.com> (raw)
In-Reply-To: <0b2c9168-01ef-e54b-fb46-9bedfbe179bd@aklaver.com>
References: <CAM-M3TkOWhUsWPtgDhaNbrNTKeHXX2mykxHaEbM_ZSQe+ozZdA@mail.gmail.com>
	<0b2c9168-01ef-e54b-fb46-9bedfbe179bd@aklaver.com>


> 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_CD and
>> 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 error pretty 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.






view thread (47+ messages)  latest in thread

Message-ID: <95C2937F-1036-4691-B682-9052C1D2B621@gmail.com>
Permalink:  ../95C2937F-1036-4691-B682-9052C1D2B621@gmail.com/
Also on:    postgresql.org/message-id/95C2937F-1036-4691-B682-9052C1D2B621@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: haramrae@gmail.com, adrian.klaver@aklaver.com, sonams1209@gmail.com
  Subject: Re: Trigger
  In-Reply-To: <95C2937F-1036-4691-B682-9052C1D2B621@gmail.com>
  References: <CAM-M3TkOWhUsWPtgDhaNbrNTKeHXX2mykxHaEbM_ZSQe+ozZdA@mail.gmail.com> <0b2c9168-01ef-e54b-fb46-9bedfbe179bd@aklaver.com> <95C2937F-1036-4691-B682-9052C1D2B621@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox