Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Location
    United States
    Posts
    22

    Unanswered: 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

  2. #2
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    db2dcs, you can't partition on a partial character column value (unless that partial value is at the beginning).

  3. #3
    Join Date
    Feb 2005
    Location
    United States
    Posts
    22

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •