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

DB2 v8 for z/OS - creating a partitioned table


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

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Thu Dec 11, 2008 4:47 am
Reply with quote

I am trying to execute the following DDL but continue to receive a -636. I know where the error is but my question is why does this DDL not execute successfully? Thanks.

CREATE TABLE DB2DBA.CMSTSTT8
( "COLA" CHAR(6) NOT NULL ,
"COLB" CHAR(4) NOT NULL)
PARTITION BY
( COLA ASC,
COLB ASC)
(PARTITION 1 ENDING AT('15047 OE46')
,PARTITION 2 ENDING AT('15047 OE50'))
IN "CMSDBT04"."CMSTSTS8"

ENDING AT (constant or MAXVALUE, ...)

# Defines the limit key for a partition boundary. Specify at
# least one value (constant or MAXVALUE) after ENDING AT in each
# PARTITION clause. You can use as many values as there are
# columns in the key. The concatenation of all values is the
# highest value of the key for ascending and the lowest for
# descending

After reading this excerpt from the IBM manual I assume the DDL statement should work. Is there an existing APAR I missed to fix this? Thanks for any help.
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: Thu Dec 11, 2008 5:47 am
Reply with quote

Hello,

Suggest you post the CREATE INDEX for the partitioning keys for this as well. . .

Also from IBM:
Quote:
-636 THE PARTITIONING KEYS FOR PARTITION part-num ARE NOT SPECIFIED IN
ASCENDING OR DESCENDING ORDER


Explanation: In the CREATE INDEX statement for the CLUSTER index for a partitioned table (that is, a table residing in a partitioned table space), the partitioning key values specified in the limit key value specifications were not in either ascending or descending order.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Dec 11, 2008 12:10 pm
Reply with quote

Hi Dave,

You tried to create a table-controlled partitioning. Only reason you got that error is due to few quotes & commas missing.

You were partitioning the table by using 2 columns PARTITION BY, and in the ENDING AT, there has to be 2 columns not 1. Values in 2 columns doesn't stick together.

I tried this in my SHOP, it worked.
Code:
CREATE TABLE shandb.testing               
( "COLA" CHAR(6) NOT NULL ,               
"COLB" CHAR(4) NOT NULL)                 
PARTITION BY                             
( COLA ASC,                               
COLB ASC)                                 
(PARTITION 1 ENDING AT('15047','OE46')   
,PARTITION 2 ENDING AT('15047','OE50'))   
IN shandb.parts



Sushanth Bobby
Back to top
View user's profile Send private message
David Joyce

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Fri Dec 12, 2008 8:07 pm
Reply with quote

Sushanth,
Thank you. I am using a tool to create the limit keys and there is no defined differentiation between values for one or two columns.
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