Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2011
    Posts
    2

    Unanswered: Create db2 table with encrypted columns

    Looking to create a DB2 table but some of the columns has to either be masked or encrypted. I am new to DB2 and new to masking/encryption function. Can this be done?

    What I am looking for is that when someone looks at my DB2 table they cannot see the actual value. But if I export the value outside the table then you could see the actual value.

    Example:

    Source Name = HP USA
    DB2 Table Name = #$%^&*(*^
    Export Flat File Name Fom Table= HP USA

    Current SQL:

    CREATE TABLE PROJECT.CUSTOMER (
    COMPANY_ID VARCHAR(10),
    COMPANY_NAME VARGRAPHIC(100),
    STREET_ADDR VARGRAPHIC(90),
    STREET_ADDR_2 VARCHAR(90),
    STREET_ADDR_3 VARGRAPHIC(90),
    CITY VARGRAPHIC(100),
    PSTL_CD VARCHAR(20),
    STATE VARCHAR(2)
    );

    I need to encrypt or mask COMPANY_NAME, STREET_ADDR, STREET_ADDR_2, and STREET_ADDR_3. The other columns can show there actual value.

  2. #2
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Last edited by DBFinder; 01-13-11 at 22:19.

  3. #3
    Join Date
    Nov 2010
    Posts
    21
    Hi,
    Try to do it with TRANSLATE function:

    export the output of below command in IXF format and then Import the same with replace_create option, this can work for you

    syntax:

    select field_name1,field_name2,
    translate(field_name3,'AaBbCcDdEeFfGgHhIiJjKkLlMmN nOoPpQqRrSsTtUuVvWwXxYyZz', 'zZeEbBrRaAsScCdDfFgGhHiIjJkKlLmMnNoOpPqQtTuUvVwWx XyY') ,
    translate(field_name4,'AaBbCcDdEeFfGgHhIiJjKkLlMmN nOoPpQqRrSsTtUuVvWwXxYyZz', 'zZeEbBrRaAsScCdDfFgGhHiIjJkKlLmMnNoOpPqQtTuUvVwWx XyY') , field_name5 from table name


    regards,
    Harsh

Posting Permissions

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