Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table TST_SimpleTable (id number not null , sProductName varchar2(50), dControlDate date, nQuantityIn number, nQuantityOut number); --select * from TST_SimpleTable; CREATE SEQUENCE seq_id MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 INCREMENT BY 1 CACHE 10; INSERT INTO TST_SimpleTable (id, sProductName, dControlDate, nQuantityIn, nQuantityOut) VALUES (seq_id.nextval, 'REEBOK', to_date('01-05-2016','DD-MM-YYYY'), round(dbms_random.value(10,20)), round(dbms_random.value(5,15))); INSERT INTO TST_SimpleTable (id, sProductName, dControlDate, nQuantityIn, nQuantityOut) VALUES (seq_id.nextval, 'NIKE' , to_date('01-05-2015','DD-MM-YYYY'), round(dbms_random.value(10,20)), round(dbms_random.value(5,15))); INSERT INTO TST_SimpleTable (id, sProductName, dControlDate, nQuantityIn, nQuantityOut) VALUES (seq_id.nextval, 'PUMA', to_date('01-05-2016','DD-MM-YYYY'), round(dbms_random.value(10,20)), round(dbms_random.value(5,15))); INSERT INTO TST_SimpleTable (id, sProductName, dControlDate, nQuantityIn, nQuantityOut) VALUES (seq_id.nextval, 'ADIDAS' , to_date('01-05-2015','DD-MM-YYYY'), round(dbms_random.value(10,20)), round(dbms_random.value(5,15))); select * from TST_SimpleTable; CREATE OR REPLACE FUNCTION INSER_T RETURN @TST_SimpleTable TABLE IS BEGIN FOR L IN 1..1000 LOOP INSERT INTO TST_SimpleTable (id, sProductName, dControlDate, nQuantityIn, nQuantityOut) VALUES (seq_id.nextval, generate_random_name_cyrillic() , Dates(), round(dbms_random.value(10,20)), round(dbms_random.value(5,15))); END LOOP; RETURN; END INSER_T;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear