How to auto create a large csv file with powershell,plsql

I need a large table to test database performance, so I wrote down a simple script to create a large CSV file.

powershell:To create a large csv data test using powershell
$count = 9999999999999

for ($i=1; $i -le $count; $i++)
{
  $line = $i.ToString() + “,” + “Thora,Temple,2013-05-26 14:47:57” ;
  Add-Content C:\Users\Hieu\actor_202102111552.csv $line;
}

plsql: To create a large data test using plsql 
CREATE OR REPLACE FUNCTION public.insertTable() RETURNS void AS $$
DECLARE
BEGIN
FOR counter IN 1..922337203
loop
     INSERT INTO public.actor
	(first_name, last_name, last_update)
	VALUES('Penelope', 'Guiness', now());

END LOOP;
END;
$$ LANGUAGE plpgsql;

Well done!!!

Maybe you need it.

“>

Thank you for reading the DevopsRoles page!

About Dang Nhu Hieu

I'm Vietnamese. In the past, I'm a software developer, now working in Japan on an Infra team. Skill : AWS, VMware, HA architech,setting Database : Oracle DB, PostgresDB ,.. Programming language : Java, C#, Python, Bash linux, Batch windows, powershell ,... Hobbies: badminton, film photo, travel. https://www.linkedin.com/in/hieu-dang-15a0561a6/
View all posts by Dang Nhu Hieu →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.