Subject | RE: [firebird-support] Temporary tables |
---|---|
Author | Kevin Lingofelter |
Post date | 2004-12-17T21:43:04Z |
Hello,
Is the schema of the returned records static? If so, you can create a
standard table with this structure and add a sessionid field (use GUID or
whatever) to "fake" a temp table. Using the sessionid, insert the records
into the table, run your queries then delete the records.
In my case I have a query which returns fields derived by all sorts of means
and can be pretty intense on resources. The same results are used several
times in a single application session so instead of running the query each
time, I have a stored procedure that "prepares" the search results by
inserting the records into the temp table and returning the session ID.
During the session, I can query those results using the session id, and
clean things up (delete the records) when the session ends.
This works very well, but in my case the schema doesn't change.
Kevin Lingofelter
Is the schema of the returned records static? If so, you can create a
standard table with this structure and add a sessionid field (use GUID or
whatever) to "fake" a temp table. Using the sessionid, insert the records
into the table, run your queries then delete the records.
In my case I have a query which returns fields derived by all sorts of means
and can be pretty intense on resources. The same results are used several
times in a single application session so instead of running the query each
time, I have a stored procedure that "prepares" the search results by
inserting the records into the temp table and returning the session ID.
During the session, I can query those results using the session id, and
clean things up (delete the records) when the session ends.
This works very well, but in my case the schema doesn't change.
Kevin Lingofelter