Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 7B9BD9FB26B for ; Thu, 4 Oct 2007 08:23:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 02505-08 for ; Thu, 4 Oct 2007 08:23:14 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by postgresql.org (Postfix) with ESMTP id B86CC9FB272 for ; Thu, 4 Oct 2007 08:23:12 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c36so18066ana for ; Thu, 04 Oct 2007 04:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:message-id:mime-version:content-type:x-mailer:x-mimeole:thread-index; bh=Ezpda4M0ZmSWM1mSl19r1+EjS5/tsOoc6WQUcw0l10w=; b=eqzn0QLcojRB64URfTbuvBem405umehoHbIQZWbzmbND+4fwoEquXjJ4R3uKpsOMFAV9TFjDL++6uJclh1rYAVZONTay9YpbuJPgbwElYk1meaWTLlUCPY8AkkbYD99Er3kwFjj2+bEhHO8zp8ZXOhH0ROS/AkyMQX0hrFtUZuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:message-id:mime-version:content-type:x-mailer:x-mimeole:thread-index; b=eT1zR+7PfkjKBSWnyueWQXciEiZCLXhoYYnyjQ/oA3snTg2hqW25DhUC9ngVbS39uP5FM0y1ZQwRD0djik5Tu/o3/j6wiKgtkBDIUoKdpym0RO0vDepUNBJNBT1LwrDC685Q1DxB5unPYkFIuGcdSMAY8fYix6986jM9ZSPj+Hs= Received: by 10.142.163.14 with SMTP id l14mr551499wfe.1191496988539; Thu, 04 Oct 2007 04:23:08 -0700 (PDT) Received: from hengky ( [125.162.255.170]) by mx.google.com with ESMTPS id b8sm3085288rvf.2007.10.04.04.23.04 (version=SSLv3 cipher=RC4-MD5); Thu, 04 Oct 2007 04:23:07 -0700 (PDT) From: "Hengky Lie" To: Subject: Rule Error Date: Thu, 4 Oct 2007 19:22:32 +0800 Message-ID: <008f01c80678$de562990$6f00a8c0@hengky> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0090_01C806BB.EC796990" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Thread-Index: AcgGeNtfy7HQct3oRgCfuJXrSPvrNw== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/21 X-Sequence-Number: 29393 This is a multi-part message in MIME format. ------=_NextPart_000_0090_01C806BB.EC796990 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Dear Friends, I have problem with rule and tried several times to solve it but not yet success. Hope someone can help me. I have 2 tables : tblmasdbt and tblmasgl. I want on every record insertion in tblmasdbt, that record also automatically insert into tblmasdbt. I need only 2 related field. So I create rule like this --------------- SQL --------------- CREATE RULE "rule1" AS ON INSERT TO "public"."tblmasdbt" DO (insert into tblmasgl (KODEGL,NAMAREK) VALUES (new.KODEGL, new.NAMAREK)); But I always get this error : ---------- ERROR MESSAGE ---------- ERROR: column "kodegl" of relation "tblmasgl" does not exist Here is the Table Structure --------------------------- CREATE TABLE "public"."tblmasgl" ( "KODEGL" VARCHAR(15) NOT NULL, "NAMAREK" VARCHAR(50), "GOLONGAN" VARCHAR(10), "AWAL" DOUBLE PRECISION DEFAULT 0, "Operator" VARCHAR(3), CONSTRAINT "tblmasgl_pkey" PRIMARY KEY("KODEGL"), CONSTRAINT "tblmasgl_fk" FOREIGN KEY ("KODEGL") REFERENCES "public"."tbltragl"("KODEGL") ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE ) WITHOUT OIDS; CREATE TABLE "public"."tblmasdbt" ( "KODEGL" VARCHAR(15) NOT NULL, "NAMAREK" VARCHAR(50), "ALAMAT" VARCHAR(75), "Telp" VARCHAR(50), "Facs" VARCHAR(50), "KOTA" VARCHAR(30), "HP" VARCHAR(20), "Plafond" DOUBLE PRECISION DEFAULT 0, "Operator" VARCHAR(3), "SALDOAWAL" DOUBLE PRECISION DEFAULT 0, CONSTRAINT "tblmasdbt_pkey" PRIMARY KEY("KODEGL") ) WITHOUT OIDS; Hope someone could help me. Thanks a lot ------=_NextPart_000_0090_01C806BB.EC796990 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Dear Friends,

 

I have problem with rule and tried several times to = solve it but not yet success. Hope someone can help = me.

 

I have 2 tables : tblmasdbt and tblmasgl. =

 

I want on every record insertion in tblmasdbt, that = record also automatically insert into tblmasdbt. I need only 2 related = field.

 

So I create rule like = this

 

--------------- SQL = ---------------

CREATE RULE "rule1" AS ON INSERT TO "public"."tblmasdbt"

DO (insert into tblmasgl (KODEGL,NAMAREK) VALUES (new.KODEGL, new.NAMAREK));

 

But I always get this error = :

 

---------- ERROR MESSAGE = ----------

 

ERROR:  column "kodegl" of relation "tblmasgl" does not exist

 

 

Here is the Table Structure =

---------------------------

 

CREATE TABLE "public"."tblmasgl" = (

  "KODEGL" VARCHAR(15) NOT NULL, =

  "NAMAREK" VARCHAR(50), =

  "GOLONGAN" VARCHAR(10), =

  "AWAL" DOUBLE PRECISION DEFAULT 0, =

  "Operator" VARCHAR(3), =

  CONSTRAINT "tblmasgl_pkey" PRIMARY KEY("KODEGL"),

  CONSTRAINT "tblmasgl_fk" FOREIGN KEY ("KODEGL")

    REFERENCES "public"."tbltragl"("KODEGL")

    ON DELETE = CASCADE

    ON UPDATE NO = ACTION

    NOT = DEFERRABLE

) WITHOUT OIDS;

 

 

 

CREATE TABLE "public"."tblmasdbt" = (

  "KODEGL" VARCHAR(15) NOT NULL, =

  "NAMAREK" VARCHAR(50), =

  "ALAMAT" VARCHAR(75), =

  "Telp" VARCHAR(50), =

  "Facs" VARCHAR(50), =

  "KOTA" VARCHAR(30),

  "HP" VARCHAR(20), =

  "Plafond" DOUBLE PRECISION DEFAULT = 0,

  "Operator" VARCHAR(3), =

  "SALDOAWAL" DOUBLE PRECISION DEFAULT = 0,

  CONSTRAINT "tblmasdbt_pkey" PRIMARY KEY("KODEGL")

) WITHOUT OIDS;

 

 

Hope someone could help me. Thanks a = lot

------=_NextPart_000_0090_01C806BB.EC796990--