Virtual table

MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Virtual table

Post by MiniMe »

Is there a way to build a table in memory during the invocation of a script, do all the processes to build a report and then the table dissapear at the end of the script.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Virtual table

Post by Kai »

<SQL "create ram table mytmptable(...)"></SQL>

Don't create any indexes on it though, as they will go to disk. See also <xtree> in Vortex for a fast in-RAM search structure.
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Virtual table

Post by MiniMe »

This is perfect.. thanks
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Virtual table

Post by MiniMe »

Is it possible to have <timport> populate the ram table??
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

Virtual table

Post by John »

Within Vortex <timport> puts the values into variables, that you can then insert into the table.
John Turnbull
Thunderstone Software
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

Virtual table

Post by bart »

I cant seem to find the doc pages describing ram table creation and dropping.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Virtual table

Post by mark »

Good point. It doesn't appear to be documented. It's basically the same though. Just add the "ram" keyword to the create. Nothing special about drop.

create ram table foo(id counter,Name varchar(20));
drop table foo;
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Virtual table

Post by Kai »

Keep in mind that the RAM table is currently tied to the <sql> handle and its derivatives, i.e. it may not always be visible to a later <sql> with different handle parentage, even for the same database and no <sqlcp cache close> (which would free any/all RAM tables).