CONNECT OLTP/OLTP@ORA10GR2
CREATE OR REPLACE PROCEDURE LOAD_DATA
IS
v_Cnt NUMBER ;
v_value NUMBER;
BEGIN
FOR i IN 1..1000000 LOOP
insert into ORDERS (
ORDER_ID ,
PRODUCT_ID ,
CUSTOMER_ID ,
PURCHASE_DATE ,
PURCHASE_TIME ,
PURCHASE_PRICE ,
SHIPPING_CHARGE,
TODAY_SPECIAL_OFFER ,
SALES_PERSON_ID ,
PAYMENT_METHOD
) values
(
TRIM(TO_CHAR(MOD(i,1000000) + 1,'0000009')),
TRIM(TO_CHAR(MOD(i,10) + 1,'0000009')),
TRIM(TO_CHAR(MOD(i,1000) + 1, '000000009')),
TO_CHAR(sysdate,'YYYYMMDD'),
TO_NUMBER(TO_CHAR(sysdate,'HH24MI')) ,
ROUND(DBMS_RANDOM.VALUE * 1000,0) ,
ROUND(DBMS_RANDOM.VALUE * 100,0) ,
MOD(i,2) + 1,
TRIM(TO_CHAR(MOD(i,10000) + 1, '000000009')) ,
TRIM(TO_CHAR(MOD(i,100) + 1,'000000009'))
);
COMMIT;
END LOOP;
/*
EXCEPTION
WHEN OTHERS THEN
null;*/
END ;
/