Hi,
It's probably easiest if I describe what I'm trying to do:
I have several tables I want to base a query on. In addition I have
some dynamic data that I want to join against that consists of several
records of information.
I could just create a temp table of the dynamic data and join it
against my tables, but I thought there was a way to create a cursor
(not based on a table i.e. with a select statement), fill it with the
dynamic data, and join the cursor against the other tables to get my
desired results.
The reason I wanted to do it this was for performance. I'd rather not
incur the hit of writing a temp table to a hard drive, so I thought
the cursor would keep it in memory (of course as long as it doesn't
force memory to get paged out to disk).
I'm not that familiar with DB2. I've read a little about temporary
tables and the temporary global table space. Would using a temp table
be more efficient than my proposal? If so, could you please explain
why? Does the DB not write a temp table to disk if it doesn't need to?
Thanks very much in advance,
William G. Yoder