Page 1 of 1

ZTable linked with TEMPORARY TABLE

Posted: 22.09.2013, 10:19
by aleroot
HI,
I have an application that make use of a lot of temporary tables, and i was wondering if it is possible to link a TEMPORARY TABLE with a ZTable object or if there is a better way to handle this kind of tables .

Anyone have any suggestion ?


Thanks.

Re: ZTable linked with TEMPORARY TABLE

Posted: 25.09.2013, 19:47
by EgonHugeist
Why wondering? Can you provide a little example?
Some more details would be usefull to support you..

Re: ZTable linked with TEMPORARY TABLE

Posted: 27.09.2013, 10:49
by aleroot
Basically I need a ZTAble that link to a Temporary table, this means that the TABLE in the database is created with :

CREATE TEMPORARY TABLE sometable (on Mysql, POstgresql, ...)
CREATE TABLE #sometable (on mssql)


I need these kind of tables because I want them dropped automatically at the Connection close moment, without worring about dropping those table by hand.

Re: ZTable linked with TEMPORARY TABLE

Posted: 28.09.2013, 17:48
by EgonHugeist
Didn't test it yet, but..

I don't see any objections to use such tables. IMHO is the TZTable not usable for that. TZTable needs meta-informations about the structures and i don't think they are available in the system-tables.

So i propose you use TZQuery instead. It might be possible you need also the TZUpdateSQL component for update/insert/delete-stmts.

Feel free to test and post your expierences..

Re: ZTable linked with TEMPORARY TABLE

Posted: 29.09.2013, 12:24
by mdaems
Hi,

It should be possible to use temporary tables for all databases that show these tables as part of the normal metadata queries (eg. mysql).
The main problem is that the metadata caches should be cleaned after creating new temporary tables and before opening the ZQuery or ZTable components.

I haven't done the stuff above myself yet. But I remember I wrote an application that used temporary tables. So it IS possible. Even using ZTable. But getting the metadata (and then have full updatable resultsets) is more difficult because of the caching issues.

Mark