怎么把user表的userid从121到5000的数据的pwd字段32位MD5加密啊
表结构如下:
userid pwd
1     123456
2     654321
……

解决方案 »

  1.   

    --用dbms_obfuscation_toolkit就可以了。
    declare
      chksum varchar2(100);
    begin
      dbms_obfuscation_toolkit.md5(input_string=>'oracle', checksum_string=>chksum);
      dbms_output.put_line(chksum);
    end;
      

  2.   

    --才发现原来有个函数可以调,那就一条语句就行了
    update "user" set pwd=dbms_obfuscation_toolkit.md5(INPUT_STRING=>pwd) where userid between 121 and 5000;
      

  3.   

    ORA-00907: missing right parenthesis
      

  4.   

    怎么会??你给的表定义对吗?
    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>
      

  5.   

    update user set pwd=dbms_obfuscation_toolkit.md5(INPUT_STRING=>pwd)
    我就是复制你的代码然后就报错ORA-00907: missing right parenthesis啊
      

  6.   

    --把user表的定义发下
    desc "user"