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 > Create db2 table with encrypted columns

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-11, 16:40
CLEvans CLEvans is offline
Registered User
 
Join Date: Jan 2011
Posts: 1
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.
Reply With Quote
  #2 (permalink)  
Old 01-13-11, 21:16
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606

Last edited by DBFinder; 01-13-11 at 21:19.
Reply With Quote
  #3 (permalink)  
Old 01-18-11, 00:48
harshrpce harshrpce is offline
Registered User
 
Join Date: Nov 2010
Posts: 12
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
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