Lets create the DB2 table like below
CREATE TABLE
U202.CUST_DATA
(U_STR CHAR(3) FOR SBCS DATA NOT
NULL,
U_REG CHAR(6) FOR SBCS DATA NOT
NULL,
U_SKU INTEGER NOT NULL,
U_GIFT CHAR(3) FOR SBCS DATA NOT
NULL,
U_CREDIT_CARD VARCHAR(40) FOR BIT DATA NOT NULL)
Now lets insert values into the table:
SET ENCRYPTION PASSWORD
='PWD1APRIL@'
INSERT INTO U202.CUST_DATA
VALUES('001',
'123456', 1234, 'LCD', ENCRYPT_TDES ('9876543210123456'))
Now To Decrypt
SET ENCRYPTION PASSWORD ='PWD1APRIL@';
SELECT DECRYPT_CHAR
("U_CREDIT_CARD") FROM U202.CUST_DATA
No comments:
Post a Comment