Populate Table with Volume Data

--==================================================================
--
-- Title       :   genrows.sql
-- Description :   Script to populate a table with requested
--                 number of rows.
--
-- Usage/Notes :   Extremely high values can use up large amounts
--                 of memory.
--
-- Copyright   :   ABCdba.com 2010
--
--==================================================================
 
ACCEPT tabname PROMPT 'Enter table name:               ';
ACCEPT genrows PROMPT 'Enter no. of rows to generate:  ';
 
CREATE TABLE &tabname
( COL1 VARCHAR2(1000) )
TABLESPACE USERS
/
 
INSERT INTO &tabname
( SELECT LEVEL FROM DUAL CONNECT BY LEVEL < (&genrows + 1) )
/
 
COMMIT
/
 
SELECT COUNT(*) FROM &tabname
/

No comments: