proper use of temp table in function

Поиск
Список
Период
Сортировка
От David Gagnon
Тема proper use of temp table in function
Дата
Msg-id 20041130151234.48813.qmail@web20323.mail.yahoo.com
обсуждение исходный текст
Список pgsql-general
Hi all,

  Sorry to ask since I'm pretty sure this kind of question have been asked
again an again.  But I searched and haven't found my answer.

So here is the question, please help :-)

In plpgsql function how do you deal with temporary table.  I need do a bunch of
data manipulations in my function before returning a ref cursor.

The problem is that, as you may know, the temp table aren't drop at the end of
the function.  And if I try to drop the tables when the cursor is open on it I
get errors too.

And I need to be able to call the function simultaneously without one
interfering with the other.  So table created by one instance of the function
don't know about tables created by other functions ...


I have 4 big selects to construct the data I need... I can't just put all in a
big one.  So I need a way to store and read data between selects.

Thanks for your help!!

/David



' LANGUAGE 'plpgsql';

CREATE FUNCTION   uk_usp_Comptabilite_AgeDeCompteClient(DATE, VARCHAR, VARCHAR,
INTEGER, INTEGER) RETURNS refcursor AS '
DECLARE



__________________________________
Do you Yahoo!?
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Marc@pyrenet.fr, G.Fournier@pyrenet.fr, From@pyrenet.fr:
Дата:
Сообщение: Re: [ANNOUNCE] USENET vs Mailing Lists Poll ...
Следующее
От: "Sally Ruggero"
Дата:
Сообщение: Re: delete with index scan