469,903 Members | 1,553 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Creating a temp table.

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.

Any suggestions?
Thanks
Ross

Nov 12 '05 #1
3 3400
ro*********@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
Nov 12 '05 #2
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

Nov 12 '05 #3
ro*********@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
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Billy Cormic | last post: by
reply views Thread by Ex-Em-El | last post: by
13 posts views Thread by EggsAckley | last post: by
7 posts views Thread by John Baker | last post: by
2 posts views Thread by Yoshitha | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.