begin
WbG*eI%}0for i in 1..5000 loopITPUB个人空间4Y'xSE0?E1a-A S"o C
if i<10 then
d|0H2I,bI n9G0insert into tb_test (role_id,name,login,password,credit_amount,currency_code_id)
T-Xxok2|.kPV0values(4,'ddz0000'||i,'ddz0000'||i,TRUNC(DBMS_RANDOM.VALUE(100000, 999999)),50000,156);ITPUB个人空间3\L1vT9N(~3N
_]
elsif i>=10 and i<100 then
/e"gNfZs(Y0insert into tb_test (role_id,name,login,password,credit_amount,currency_code_id)ITPUB个人空间m'Y`d*wD
values(4,'ddz000'||i,'ddz000'||i,TRUNC(DBMS_RANDOM.VALUE(100000, 999999)),50000,156);ITPUB个人空间2Z!M#cHYMA$i0U9T5{$b
elsif i>=100 and i<1000 then
-o;i(]Ix
x0insert into tb_test (role_id,name,login,password,credit_amount,currency_code_id)
EkvrJ@0values(4,'ddz00'||i,'ddz00'||i,TRUNC(DBMS_RANDOM.VALUE(100000, 999999)),50000,156);
T/E-fyi(C*N!V0elsif i>=1000 and i<=5000 thenITPUB个人空间u.Y"xQUo
insert into tb_test (role_id,name,login,password,credit_amount,currency_code_id)ITPUB个人空间4FkU}SW)V%SqW,n
values(4,'ddz0'||i,'ddz0'||i,TRUNC(DBMS_RANDOM.VALUE(100000, 999999)),50000,156);
+Bg.xr7VDMK O0end if;
;l bvmNw0end loop;ITPUB个人空间 _
[iO:Gq
commit;ITPUB个人空间7fx8I$`6Wv#Y
end;ITPUB个人空间2j$FV,DX_C!eQ
)c6[`w)J0select TRUNC(DBMS_RANDOM.VALUE(100000, 999999) from dual;ITPUB个人空间/w"Y th\t I"D+Y
会产生100000,999999之间的6位数字,所以就达到了随机产生6位用户数字密码的功能ITPUB个人空间cI9vf3N
备注:以上语句是用oracle 的pl/sql 语法