Oracle
循環插入測試數據(網上收集整理)
??????????????????????????????????????
??? 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('
成功錄入數據!
');
??? commit;
??? end;
SYS_GUID()?
生成
GUID ORACLE
NEWID??
生成
GUID? SQLSERVERR
declare
|
定義部分標識
|
maxrecords constant int:=100;
|
定義
maxrecords
為整型常量
100
|
i int :=1;
|
定義
i
為整型值變量,初值為
1
|
Begin
|
執行部分標識
|
for i in 1..maxrecords loop
|
i
從
1
循環到
maxrecords
|
Insert into tempuser.testtable(recordnumber,currentdate) values (i,sysdate);
|
向數據表中插入數據
|
end loop;
|
結束循環
|
dbms_output.put_line('
成功錄入數據!
');
|
顯示成功錄入數據信息
|
commit;
|
提交結果
|
end;
|
結束執行
|
|----------------------------------------------------------------------------------------|
版權聲明 版權所有 @zhyiwww
引用請注明來源 http://www.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2006-05-23 17:14
zhyiwww 閱讀(10030)
評論(8) 編輯 收藏 所屬分類:
database