Unix Technical Forum

Creating a temp table.

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 ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:20 AM
ross.oneill@gmail.com
 
Posts: n/a
Default 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 06:20 AM
Knut Stolze
 
Posts: n/a
Default Re: Creating a temp table.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 06:20 AM
ross.oneill@gmail.com
 
Posts: n/a
Default Re: Creating a temp table.

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 06:20 AM
Knut Stolze
 
Posts: n/a
Default Re: Creating a temp table.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com