From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Vijay Kumar <vijay@kinera.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with temporary table -- Urgent
Date: Fri, 11 Jul 2003 21:03:31 -0700 (PDT)
Message-ID: <20030711205654.U3777-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <000801c346be$cf166db0$cf01a8c0@vijay>
On Thu, 10 Jul 2003, Vijay Kumar wrote:
> Hi,
> We are using postgresql 7.3.3, we are encountering the following problems when we used temporary tables.
>
> Here with i'm sending my Sample function.
>
> create or replace function TestTemp_refcur(refcursor) returns refcursor As '
> declare
> refc alias for $1;
> lString Varchar(4000);
> begin
> lString := '' CREATE OR REPLACE FUNCTION TESTTEMP() RETURNS varchar as ''''
>
> BEGIN '';
> lString := lString || '' create temporary table temp_Table( Name Numeric);'';
>
> lString := lString || '' insert into temp_Table values (1); '';
>
> lString := lString || '' insert into temp_Table values (2);'';
>
> lString := lString || '' return null; end;'''' language ''''plpgsql'''';'';
>
> raise notice '' Notice is % '', lString;
> execute lString;
Okay, this create a function which would create the table and insert some
stuff. But you don't actually appear to call it afaics.
> open refc for select * from temp_Table;
I think you may need to use open for execute here as well to make it work
with temporary tables in any case.
> return refc;
> end;
> ' language 'plpgsql';
>
> begin;
> select TestTemp_refcur('funcursor');
> fetch all in funcursor;
> commit;
>
>
> psql:test18.sql:25: WARNING: Error occurred while executing PL/pgSQL function t
> esttemp_refcur
> psql:test18.sql:25: WARNING: line 20 at open
> psql:test18.sql:25: ERROR: Relation "temp_table" does not exist
> psql:test18.sql:26: ERROR: current transaction is aborted, queries ignored unti
> l end of transaction block
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: sszabo@megazone.bigpanda.com, vijay@kinera.com
Subject: Re: Problem with temporary table -- Urgent
In-Reply-To: <20030711205654.U3777-100000@megazone.bigpanda.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