IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQLCODE = -904, when DECLARE GLOBAL TEMPORARY TABLE used


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Apr 03, 2009 4:08 pm
Reply with quote

Hi Guyz,

When i am trying to declare a global temporary table i getting following error in SPUFI.
Code:
  DECLARE GLOBAL TEMPORARY TABLE DEPTTMP                                       
    (DEPT    SMALLINT NOT NULL                                                 
    ,NAME    CHAR(5)  NOT NULL                                                 
    )                                                                           
  ;                                                                             
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -904, ERROR:  UNSUCCESSFUL EXECUTION CAUSED BY AN           
         UNAVAILABLE RESOURCE. REASON 00E7009A, TYPE OF RESOURCE 200, AND       
         RESOURCE NAME TABLESPACE IN TEMPDB                                     
DSNT418I SQLSTATE   = 57011 SQLSTATE RETURN CODE                               
DSNT415I SQLERRP    = DSNXIDCL SQL PROCEDURE DETECTING ERROR                   
DSNT416I SQLERRD    = 15 0  0  -1  0  0 SQL DIAGNOSTIC INFORMATION             
DSNT416I SQLERRD    = X'0000000F'  X'00000000'  X'00000000'  X'FFFFFFFF'       
         X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION                   
---------+---------+---------+---------+---------+---------+---------+---------+


I already have a TEMPDB database and a SEGmented tablespace[ TMPSTS01 ] in it. But, still i am getting this error. I checked the RESTRICTive states of the database, everything is fine.

So, can i know the reason for this error ? Anything wrong or missing in my DECLARE TABLE syntax ?

Thank You in Advance,
Sushanth Bobby
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Apr 03, 2009 6:26 pm
Reply with quote

try declaring it as

DECLARE GLOBAL TEMPORARY TABLE SESSION.DEPTTMP
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Apr 03, 2009 6:30 pm
Reply with quote

Still getting the SAME error message ASHIMER.

Sushanth
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Apr 03, 2009 6:36 pm
Reply with quote

pls chk the follwing

does the table space in TEMPDB database has a page size that is large enough for the declared global temporary table.

Is TEMPDB database available at the time of execution ?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Apr 03, 2009 6:46 pm
Reply with quote

Ashimer,

This is DDL of TEMPDB.

Code:
 CREATE DATABASE TEMPDB         
        AS TEMP                 
        STOGROUP SYSDEFLT       
        BUFFERPOOL BP0         
        INDEXBP    BP0;         
                               

CREATE TABLESPACE TMPSTS01 IN TEMPDB
USING STOGROUP SYSDEFLT       
             PRIQTY 12               
              SECQTY 12               
              ERASE NO               
        SEGSIZE 4                     
        BUFFERPOOL BP0               
        CLOSE YES;                   


Quote:
does the table space in TEMPDB database has a page size that is large enough for the declared global temporary table

Iam just declaring a SMALLINT & CHAR(5) table.

Yes it is available. I check the RESTRICTION STATES in governor.

Thank You,
Sushanth
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Fri Apr 03, 2009 11:15 pm
Reply with quote

Hi Sushanth Bobby

Try to create temporary database, tablespace and table in a single UR.

Then post the response of the system in the forum.

Regards
Raghu
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sat Apr 04, 2009 8:42 am
Reply with quote

Hi Raghu,

Temporary Database & a tablespace in that temporary database already exists in the sub-system. The DDL of the existing TEMPDB & Tablepspace is what i have posted earlier.
I came across this link , according to it may be i have to alter the existing tablespace bufferpool size to 8K, right now it is BP0(which is 4K).

Will try this out & let you guyz know.

Sushanth
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Apr 06, 2009 10:25 am
Reply with quote

Guyz,

It worked.

Thank You,
Sushanth Bobby
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 06, 2009 7:21 pm
Reply with quote

Good to hear it worked - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top