Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2009
    Posts
    4

    Unanswered: DB2 Primary Keys Masking

    Hi,
    We need to mask out the data in the primay key columns like 512345 should be masked to 500000 with out losing uniqueness. Can anyone please tell me a viable approach?

    Thanks.

  2. #2
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    which db2 version you are using?
    IBM Certified Database Associate, DB2 9 for LUW

  3. #3
    Join Date
    Apr 2009
    Posts
    4
    We are using DB2 9.0 on AIX

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    the db2 platform/version will not solve the problem
    what is the purpose of this and how did you try this ??
    be as specific as possible to complete the scenario/messages....
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I am not sure how this should work. You ignore the last 5 digits (or set them to 0) and still want to get unique values? How would you handle 512345 and 598765?

    Getting the result you mentioned can be done by:
    Code:
    SELECT(  col / 100000 ) * 100000
    FROM ...
    of course. (That's standard programming technique.)
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  6. #6
    Join Date
    Apr 2009
    Posts
    4
    Yes, I still want to have uniqueness between the rows of a table. Can any one suggest the best alg. for this requirement.

  7. #7
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Once you answer my question: how will could you guarantee uniqueness, i.e. what should happen with the values, we can tell you how to do that.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  8. #8
    Join Date
    Apr 2009
    Posts
    4
    Hi Stolze,
    I am in need of an alg./ method that will scramble the numbers in a key column with out affecting it's unique property. i.e. even after scrambling, I should able to find that row uniquely using the new scrambled value in that key column.

    Could you please suggest me something of this sort?

  9. #9
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    What do you mean with "scramble"?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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