On Tue, Jan 31, 2006 at 07:01:53PM +1000, Lee Marks wrote:
Hi Niels,
On Tue, 31 Jan 2006 07:58:04 +0100 Niels Nes
wrote: indeed the syntax is slightly wrong. Try the following statement instead.
create local temporary table foo (abc integer);
Thanks, this works though not quite as I had expected! The created temp table only persists for the duration of a single batch execution rather than for the duration of the connection.
In other words, if I say
create local temporary table foo (abc integer); insert into foo values(1); insert into foo values(2); select * from foo;
and execute the whole thing in one go, no problem. But I can't create the temp table first and then separately execute the insert and select statements. Is there any way to have connection-scoped persistence?
Indeed the current implementation of temporary tables is limited. Temporary tables currently only live in one transaction. Also there is currently no difference between global and local temporary tables. Clearly you found a missing feature (maybe you could file this feature request on the sourceforge pages). We hope to add this feature soon, hopefully in our next release. Niels
Thanks, Lee
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl