I normally use SQL Server but for this project I'm having to learn DB2. If I can get the below code to work I'm set for the whole project. Below is a elementary example of what I cannot get to work. All I want to do is make a Created Global Temp Table (CGTT) and append data to it. The same code below will work if I use a Declared Global Temp Table, but for my purposes I must have a CGTT.
CREATE GLOBAL TEMPORARY TABLE TEST_TBL(
KEY_ID BIGINT,
SOMETEXT VARCHAR(10)
);
INSERT INTO USERID.TEST_TBL
VALUES(123456,'TEST TEST');
SELECT * FROM USERID.TEST_TBL;
SELECT COUNT(*) FROM USERID.TEST_TBL;
The above executes fine with no errors. When the insert is executed it even tells me "1 row updated". However, the select * and count(*) both give me 0 results; I'm wondering if this is a permissions issue, but can I have permissions to create a CGTT but not insert to it??
Any help provided would be most appreciated. Thanks in advance.
