loop thru text file or database records and execute sql

Discuss RoboTask here
Post Reply
asawyer13
Posts: 11
Joined: Mon Jul 04, 2022 7:20 am

loop thru text file or database records and execute sql

Post by asawyer13 »

Without going into too much detail as to why I have to do this, I want to explain what I want to do.

I want to create a table where each row is a sql command I want to run. These could be queries, possibly with parameters, could be inserts, deletes.

I would like to be able to loop thru these records and execute the sql statements one at a time. I would also like log in another table the rownumber, maybe even the actual sql statement and how long the statement took to run. I don't think I care about how many records were updated/inserted.

I also want the total queries to be able to run as long as they need to without any timeouts. I will be accessing a mysql database if that's needed.

I am fairly new to RoboTask, so if someone could help me get started that would be great.

Thanks
Alan
Oleg
Site Admin
Posts: 3011
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: loop thru text file or database records and execute sql

Post by Oleg »

I am fairly new to RoboTask, so if someone could help me get started that would be great.
First create a table in the database and put there all SQL expressions you want. One SQL per row.
You can process them by using Dataset loop

Another way:
create text files with SQL expressions. One SQL pre file.
You can process them by using File Loop
Oleg Yershov
Post Reply