pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yohanes Purnomo <yohanes@logicsoftware.info>
To: pgsql-sql@postgresql.org
Subject: Error OID
Date: Tue, 4 Dec 2007 21:24:22 -0500 (EST)
Message-ID: <1254.222.124.95.13.1196821462.squirrel@email.powweb.com> (raw)

Hi all,

I have a big table:

CREATE TABLE Jurnal (Rekening Char(4) NOT NULL,  Debet Numeric(9) NOT
NULL,  Kredit Numeric(9) NOT NULL)
INSERT INTO Jurnal (Rekening,Debet,Kredit) values ('0001',1,2);
INSERT INTO Jurnal (Rekening,Debet,Kredit) values ('0002',3,4);



I create a function:

CREATE OR REPLACE FUNCTION ReProses()
RETURNS BOOLEAN
AS $$

DECLARE
	nHasil	Numeric;

BEGIN
   	CREATE TEMP TABLE tmpTtlRekening WITHOUT OIDS ON COMMIT DROP
   	    AS
   	SELECT Rekening, SUM(Debet) AS Debet, SUM(Kredit) AS Kredit
   	  FROM Jurnal
  GROUP BY Rekening;

   	SELECT COALESCE(SUM(Debet - Kredit), 0)
   	  INTO nHasil
   	  FROM tmpTtlRekening;

   	  -- bla,bla
   	  RETURN '1';
END;
$$ LANGUAGE 'plpgsql';


Execute Query:

SELECT ReProses()

Result is fine, but when i execute again

SELECT ReProses()

ERROR: relation with OID 41573 does not exist



Can anyone help me

thanks




view thread (3+ messages)  latest in thread

Message-ID: <1254.222.124.95.13.1196821462.squirrel@email.powweb.com>
Permalink:  ../1254.222.124.95.13.1196821462.squirrel@email.powweb.com/
Also on:    postgresql.org/message-id/1254.222.124.95.13.1196821462.squirrel@email.powweb.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: yohanes@logicsoftware.info
  Subject: Re: Error OID
  In-Reply-To: <1254.222.124.95.13.1196821462.squirrel@email.powweb.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