Home > Database > Mysql Tutorial > Oracle利用存储过程造数据

Oracle利用存储过程造数据

WBOY
Release: 2016-06-07 16:56:05
Original
1501 people have browsed it

假定表里面已经有一些数据了,现在要通过存储过程来让已有的数据不停的翻番,已造出大量的数据 CREATE OR REPLACE PROCED

  假定表里面已经有一些数据了,现在要通过存储过程来让已有的数据不停的翻番,已造出大量的数据

  CREATE OR REPLACE PROCEDURE "INSERTDATA"

  AS

  distance int;

  BEGIN

  distance := 0;

  loop

  INSERT INTO user.table

  (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, TEST)

  SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, TEST

  FROM user.table;

  exit when distance > 4;

  distance := distance + 1;

  end loop;

  commit;

  END;

  完了,可以查一下表的大小

  select round(sum(bytes)/(1024*1024),2) from user_extents where segment_name = 'user.table';

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template