What would be the syntax for testing if there is already a global temporary table in DB2 for IBM i 7.1?
I tried this after DECLARE GLOBAL TEMPORARY TABLE
:
SELECT * FROM QSYS2.SYSTABLES WHERE SYSTEM_TABLE_SCHEMA = 'QTEMP';
and it returned an empty result set. The permanent tables seem to be included into that view, but not the temporary tables.
Ultimately I need to conditionally drop a temp table or truncate/delete data if it exists.