Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SQLCODE = -20183 while creating a partitioned table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
masterlock

New User


Joined: 16 Mar 2007
Posts: 6
Location: India

PostPosted: Fri Feb 12, 2010 12:52 pm    Post subject: SQLCODE = -20183 while creating a partitioned table
Reply with quote

Hi Experts,

I have a requirement for partitioning a table. I tried the below query in our shop -

Code:
CREATE TABLE ACEDB002.PARTTB   
( EMPNO SMALLINT,               
  FNAME CHAR(10),               
  STATE CHAR(2))               
PARTITION BY (EMPNO ASC)       
  (PARTITION 1 ENDING AT ( 100),
   PARTITION 2 ENDING AT ( 200),
   PARTITION 3 ENDING AT ( 300))
IN ACEDB002.ACESLOCL;


Below is the error that I am getting in SPUFI.

Code:
DSNT408I SQLCODE = -20183, ERROR:  THE PARTITIONED, ADD PARTITION, ADD 
         PARTITIONING KEY, ALTER PARTITION, OR ROTATE PARTITION CLAUSE 
         SPECIFIED ON CREATE OR ALTER FOR ACEDB002.PARTTB IS NOT VALID 
DSNT418I SQLSTATE   = 428FT SQLSTATE RETURN CODE                       
DSNT415I SQLERRP    = DSNXIPKY SQL PROCEDURE DETECTING ERROR           
DSNT416I SQLERRD    = 5 0  0  -1  0  0 SQL DIAGNOSTIC INFORMATION       
DSNT416I SQLERRD    = X'00000005'  X'00000000'  X'00000000'  X'FFFFFFFF'
         X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION           

The DB2 version I am using is 8.1 which should support Table Controlled Partition. Following is the snapshot of -DIS GROUP

Code:
*** BEGIN DISPLAY OF GROUP(DSND01G ) GROUP LEVEL(810) MODE(N)
                  PROTOCOL LEVEL(2)  GROUP ATTACH NAME(D01G) 

Can you plase tell me why I am getting this error?
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Fri Feb 12, 2010 1:04 pm    Post subject:
Reply with quote

Hello,

Look here:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnmcj10/2.1.6.504
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Feb 12, 2010 2:57 pm    Post subject:
Reply with quote

MasterLock,

Try this,
Code:
CREATE TABLE ACEDB002.PARTTB   
( EMPNO SMALLINT,               
  FNAME CHAR(10),               
  STATE CHAR(2))                IN ACEDB002.ACESLOCL
PARTITION BY (EMPNO ASC)       
  (PARTITION 1 ENDING AT ( 100),
   PARTITION 2 ENDING AT ( 200),
   PARTITION 3 ENDING AT ( 300)) ;


Does ACESLOCL tablespace has 3 partitions ?

Masterlock you need to unlock & explore DB2 V8 - SQL REFERENCE manual.

Thanks,
Sushanth
Back to top
View user's profile Send private message
masterlock

New User


Joined: 16 Mar 2007
Posts: 6
Location: India

PostPosted: Fri Feb 12, 2010 3:10 pm    Post subject:
Reply with quote

Thanks everyone,

My initial query is working now. The problem was with the non-partitioned tablespace as you mentioned.

Can we use any scalar function in the PARTITION BY clause? For example if we need to partion based on the last two digits of an employee id.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Feb 12, 2010 3:36 pm    Post subject:
Reply with quote

Quote:
Can we use any scalar function in the PARTITION BY clause?


Try, let us know if you have any errors.

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

New User


Joined: 16 Mar 2007
Posts: 6
Location: India

PostPosted: Fri Feb 12, 2010 3:51 pm    Post subject:
Reply with quote

I have tried as PARTITION BY (MOD(EMPNO,10) ASC) but it is not working. Just wanted to know if this feature is availabe in DB2 or not.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Feb 12, 2010 4:06 pm    Post subject:
Reply with quote

Masterlock,

Hmm....

You can have index on expressions, in which you can use SCALAR functions. Combine it with index partitioning.

You will have what you want.

But, the problem is, to it i have be in v9.

Good news is last week IBM announced V10.

Thanks,
Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us