This is a discussion on Creating a temp table. within the DB2 forums, part of the Database Server Software category; --> Hi I want to create a temp table called DECLARE LOCAL TEMPORARY TABLE tempdate(test integer) in VDATE; but I ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| ross.oneill@gmail.com wrote: > Hi > I want to create a temp table called > > DECLARE LOCAL TEMPORARY TABLE tempdate(test integer) in VDATE; > > but I always get an error. I read that I have to create a Table space > so I did. Without the exact error message, I'm just guessing. I think you have not created a USER TEMPORARY tablespace? -- Knut Stolze DB2 Information Integration Development IBM Germany |
| |||
| Hi Knut, Thanks for your response. I will try and create a USER TEMPORARY tablespace Below is the error message. DECLARE LOCAL TEMPORARY TABLE tempdate(test integer) in VDATE; ------------------------------------------------------------------------------ DECLARE LOCAL TEMPORARY TABLE tempdate(test integer) in VDATE DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token "DECLARE LOCAL TEMPORARY TABL" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<create_table_of_type>". SQLSTATE=42601 SQL0104N An unexpected token "DECLARE LOCAL TEMPORARY TABL" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<create_table_of_type>". Explanation: A syntax error in the SQL statement or the input command string for the SYSPROC.ADMIN_CMD procedure was detected at the specified token following the text "<text>". The "<text>" field indicates the 20 characters of the SQL statement or the input command string for the SYSPROC.ADMIN_CMD procedure that preceded the token that is not valid. As an aid, a partial list of valid tokens is provided in the SQLERRM field of the SQLCA as "<token-list>". This list assumes the statement is correct to that point. The statement cannot be processed. User Response: Examine and correct the statement in the area of the specified token. sqlcode : -104 sqlstate : 42601 |
| ||||
| ross.oneill@gmail.com wrote: > Hi Knut, > Thanks for your response. I will try and create a USER TEMPORARY > tablespace > > > > Below is the error message. > > > > DECLARE LOCAL TEMPORARY TABLE tempdate(test integer) in VDATE; I should have had a closer look at your statement. DB2 does not yet support local temp tables. You have to create a global one: http://tinyurl.com/8g4ve -- Knut Stolze DB2 Information Integration Development IBM Germany |