Auto create a large csv file with powershell,plsql

I need a large table to test database performance, so i noted my simple script for creating large csv file.

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
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.

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 Database : Oracle DB, PostgresDB ,.. Programming language : Java, C#, Python, Bash linux, Batch windows, powershell ,... Hobbies: badminton, film photo, travel. My instagram:https://www.instagram.com/dangnhuhieu/
View all posts by Dang Nhu Hieu →

Leave a Reply

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

Comment moderation is enabled. Your comment may take some time to appear.

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