UDBDBA wrote:
Hi Serge:
IMPORT or LOAD does not work on DGTT.
$ db2 " import from dummy.del of del replace into
SESSION.\"#ts155a_move_data\" "
SQL3015N An SQL error "-526" occurred during processing.
SQL0526N The requested function does not apply to declared temporary
tables.
SQLSTATE=42995
Correct. Feel free to submit a requirement.
IMPORT is certainly not hard....
Can you elaborate on your note:
Compare with (funky) delete:
* truncate the temp table
* done!
Not much to elaborate.
When you declare tge global temp outside that loop of your then there
will be no statement ivalidation inside the loop, so no recompiles either.
Of course there will be be no DROP/DECLARE or DECLARE WITH REPLACE
because you moved it outside the loop.
So the only thing that's needed now is to do the DELETE.
Causing a run time error during a delete/update/insert to a global temp
which is NOT LOGGED will cause truncation (using the same algorithms
used on DROP/REPLACE.
So:
DELETE FROM SESSION.TEMP WHERE pk = CAST(raise_error('78000', 'bang') AS
INT);
will truncate the temp as efficient as possible.
If the cost simply moved from the DECLARE to the DELETE as seen in the
profiler, then that means that the cost was indeed mostly in the
truncation of temp.. Not much that can be done about that then....
Cheers
Serge
PS: Feel free to send me that screenshot
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab