17,377
社区成员
发帖
与我相关
我的任务
分享
--把user表的定义发下
desc "user"
scott@ORA11GR2> create table "user"(userid int, pwd varchar2(100));
Table created.
scott@ORA11GR2> insert into "user" values(121, '123456');
1 row created.
scott@ORA11GR2> insert into "user" values(5000, '654321');
1 row created.
scott@ORA11GR2> insert into "user" values(7000, '65321');
1 row created.
scott@ORA11GR2> update "user" set pwd=dbms_obfuscation_toolkit.md5(INPUT_STRING=>pwd)
2 where userid between 121 and 5000;
2 rows updated.
scott@ORA11GR2>
--才发现原来有个函数可以调,那就一条语句就行了
update "user" set pwd=dbms_obfuscation_toolkit.md5(INPUT_STRING=>pwd) where userid between 121 and 5000;
--用dbms_obfuscation_toolkit就可以了。
declare
chksum varchar2(100);
begin
dbms_obfuscation_toolkit.md5(input_string=>'oracle', checksum_string=>chksum);
dbms_output.put_line(chksum);
end;