Oracle
循環(huán)插入測試數(shù)據(jù)(網(wǎng)上收集整理)
??????????????????????????????????????
??? declare
??????? maxrecords constant int:=1000;
??????? i int :=1;
??? begin
??????? for i in 1..maxrecords loop
????????? insert into UserInfo(UserID,login,password,firstName,lastName,ISADMINISTRATOR)
?????????? values(SYS_GUID(),TO_CHAR('9999'+i),'password','fristname','lastName','0');
??????? end loop;
??? dbms_output.put_line('
成功錄入數(shù)據(jù)!
');
??? commit;
??? end;
SYS_GUID()?
生成
GUID ORACLE
NEWID??
生成
GUID? SQLSERVERR
declare
|
定義部分標(biāo)識
|
maxrecords constant int:=100;
|
定義
maxrecords
為整型常量
100
|
i int :=1;
|
定義
i
為整型值變量,初值為
1
|
Begin
|
執(zhí)行部分標(biāo)識
|
for i in 1..maxrecords loop
|
i
從
1
循環(huán)到
maxrecords
|
Insert into tempuser.testtable(recordnumber,currentdate) values (i,sysdate);
|
向數(shù)據(jù)表中插入數(shù)據(jù)
|
end loop;
|
結(jié)束循環(huán)
|
dbms_output.put_line('
成功錄入數(shù)據(jù)!
');
|
顯示成功錄入數(shù)據(jù)信息
|
commit;
|
提交結(jié)果
|
end;
|
結(jié)束執(zhí)行
|
|----------------------------------------------------------------------------------------|
版權(quán)聲明 版權(quán)所有 @zhyiwww
引用請注明來源 http://www.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2006-05-23 17:14
zhyiwww 閱讀(10030)
評論(8) 編輯 收藏 所屬分類:
database