1、新建java source窗口
2、右键编辑 新建一个java soure 输入 name class
3、create or replace and compile java source named fieldencrypt as 新建完之后自带的 不可删除
直接粘贴代码就行
4、新建一个sql windows窗口 创建函数
create or replace procedure zysj_field_encrypt
as language java
name 'Hello.run()';
5、执行完后直接在sql中使用即可
UPDATE cm_cust_info
SET
cust_name = zysj_field_encrypt(cust_name, to_char(cust_id)),
cust_Cert_code = zysj_field_encrypt(cust_Cert_code, to_char(cust_id)),
cust_Cert_Addr = zysj_field_encrypt(cust_Cert_Addr, to_char(cust_id)),
remark = remark || 'info'
WHERE cust_id IN (
SELECT cust_id
FROM (
SELECT cust_id
FROM cm_cust_info
WHERE remark NOT LIKE '%info%'
AND ROWNUM <= 50000
)
);