Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6dhD-0005bs-V8 for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 17:08:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6dhC-0004XG-2R for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 17:08:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6dhB-0004X8-My for pgsql-general@lists.postgresql.org; Tue, 25 Feb 2020 17:08:33 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j6dh9-0006Xn-6n for pgsql-general@postgresql.org; Tue, 25 Feb 2020 17:08:32 +0000 Received: by mail-wm1-x330.google.com with SMTP id c84so3943250wme.4 for ; Tue, 25 Feb 2020 09:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4soJXjlIny+BcLYbzhsfMEeNzsT5uqqwDjomUcnXCQQ=; b=owD6qGQHyJMa+qFJh0tM1pn8LUUmH2sod0xA9xGklpstbS0DBMi+4PTPYvCeVci2Ad vLoDHNeiOEQNiFGVxJJEeHvmKvb4XfxjM5BpUMldU3p7S9vU9CuV6ii9rBUO9rbOipR6 picwGXkm0zK3/X5QrmREN5CKJTP1r8uHPGbd41VnuxXQEoeCBGEMOTr4OibO86sIa4Jl vVpIRTgaHDpBdqTZWIlvoY+PqAphNoVDHNKg7qhjNKTIrBADsOG5553Xw+HkNkH/4evJ yZwDcLDKNJb0N+90FDcluAfkDyNNT6z3zgOUN5mFjV/1+KTeWQTKjbrhebCzGJs+oYVN w8tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4soJXjlIny+BcLYbzhsfMEeNzsT5uqqwDjomUcnXCQQ=; b=i83yYzbr+X4KXoqVIAKCeHyjKMnyLXpeIAD3VwKVSYwtmz9sqdW6gWzzKmnY8wnaQ5 2zEmEKEuzYkVV9ssOqapllhE9yt8ONQFDFD3qediKmCm2CaF2FfxBH335Du3FFzmL4S9 wrJC2a/6i5YVZmtZBwdW1ZH3tg6qQx5ZG3UDuNq7dpD8lGkn6hV2lX01H/FrUdQJAX2S P9ObXtbcTWHScohF2S9muLlDyQzqkow/xlb1sz53qZ3W+fdvbZg+J7zIAAzI2lAy8sDf pNuip/Rgr1X2JB0fkDbCmydVP4Oieh22TmWXrSQNXznBAiF2+19UPaJKQOLn5BdQCULJ /kbA== X-Gm-Message-State: APjAAAXxzhWS0ETZeV6xSRQmbUXePedq8LqZe7rM1E8BCuGaBTiMLyBc AAWcve83LuyHTmnDkFMrybk= X-Google-Smtp-Source: APXvYqx+G6WyZvnpLvb3j49HcKMbFGDcyA1F7WwSg+Ok7cL4x0PQlUoZt12EhfXpToLWMOfk+4ET+w== X-Received: by 2002:a05:600c:2503:: with SMTP id d3mr256367wma.84.1582650509670; Tue, 25 Feb 2020 09:08:29 -0800 (PST) Received: from hollewijn.internal (217-19-30-105.dsl.cambrium.nl. [217.19.30.105]) by smtp.gmail.com with ESMTPSA id s8sm26132959wrt.57.2020.02.25.09.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2020 09:08:29 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Trigger From: Alban Hertroys In-Reply-To: <0b2c9168-01ef-e54b-fb46-9bedfbe179bd@aklaver.com> Date: Tue, 25 Feb 2020 18:08:27 +0100 Cc: Sonam Sharma , pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: <95C2937F-1036-4691-B682-9052C1D2B621@gmail.com> References: <0b2c9168-01ef-e54b-fb46-9bedfbe179bd@aklaver.com> To: Adrian Klaver X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 25 Feb 2020, at 17:53, Adrian Klaver = wrote: >=20 > 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 >=20 >> if exc_count =3D 0 then >> UPDATE pps.T8071_CAI_IVO_HDR SET IVO_STS_CD =3D 1 where = T616_VBU_NBR=3Dold.T616_VBU_NBR and T617_FNC_TYP_CD=3Dold.T617_FNC_TYP_CD = and >> T8071_CAI_IVO_ID=3Dold.T8071_CAI_IVO_ID and T8071_ADD_DM=3D old. = T8071_ADD_DM and old.ivo_sts_cd !=3D 10 and old.ivo_sts_cd !=3D 3; >=20 > 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=E2=80=99m 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=E2=80=99s 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.