If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 partition based on a partial column value

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-09-11, 12:30
db2dcs db2dcs is offline
Registered User
 
Join Date: Feb 2005
Location: United States
Posts: 20
DB2 partition based on a partial column value

We are running DB2 V9 in a mainframe (Z/OS) environment.

Lets say we have the following 4 column table laid out in this COLNO order:

COLNO NAME COLTYPE LENGTH
====== ==== ======= ======
01 UID INTEGER
02 EMPLNO CHAR 8
03 SSN CHAR 9
04 UPDT_TS TIMESTAMP

I have left the question of indices out for the time being; albeit, I recognize that the answer to this question may be based on the separate issue of what the indices look like.

My question is: without having to introduce a 5th column, is it possible to create a partitioning strategy for the above table that is based on the last 2 digits of the SSN column ?
Or does one have to have an additional CHAR(2) column (or something similar) that is maintained and which houses the last 2 digits of the SSN?
I ask the question independant of whether it is a pre-Version-8 "index-controlled" partition, or a Verson-8 and beyond "table-controlled" partition; although I recognize that the type of partition will probably be included in the answer. thank-you in advance to anyone who can provide an answer.

regards
db2dcs
Reply With Quote
  #2 (permalink)  
Old 09-09-11, 13:12
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
db2dcs, you can't partition on a partial character column value (unless that partial value is at the beginning).
Reply With Quote
  #3 (permalink)  
Old 09-09-11, 14:00
db2dcs db2dcs is offline
Registered User
 
Join Date: Feb 2005
Location: United States
Posts: 20
Smile

Thank-you StealthDBA for your answer. T'was what I thought; but I am always hoping that some day a new DB2 release will enable that capability to exist.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On