---
title: "Oracle随机生成数字存储过程"
author: "Forestsai"
date: "2011-06-03T17:57:37Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2011-06-03T17:57:37Z"
id: 1069777
url: "https://forestsai.iteye.com/blog/1069777"
---

```
create or replace procedure create_callstatistic
as
begin
for i in 1..4000000
loop
insert into up_callstatistic_data(USERIDENTIFIER,UPNUMBER,CALLINGADDRESS,CALLINGAREANUMBER,CALLEDADDRESS,CALLEDAREANUMBER,CALLSTARTTIME)
 values(round(dbms_random.value(1000000000,2000000000)),round(dbms_random.value(4008000000,4008999999)),round(dbms_random.value(51180000000,51189999999)),round(dbms_random.value(350,999)),round(dbms_random.value(51180000000,51189999999)),round(dbms_random.value(350,999)),'2011031311'||round(dbms_random.value(00,59))||round(dbms_random.value(00,59)));
commit;
end loop；
```

```
end;
```