I have a database with multiple tables(around 100) with records stored based on category. Each category is a table and , each table holds multiple items. Each item is having multiple transaction records for each day, whenever there is a transaction happened with multiple fields for each row.
I need to fetch the records for each item based on a condition, and do some operations(ex: aggregation of some sort) in the app(a PHP or Python program). The results are stored again in another database table.
At present I am running the operations manually for each Item.Executing the program for each item by passing the item as parameter. But I am pressed against the situation where I am getting new categories and new items every day, making me adjust the manual execution very difficult.
Below are the ways in which I have tried to automate, but none of them are working.
$data['results'] = $this->scripts_model-> run_daily_stats($item, $Parameter1, $Paramet2);
//Use the Results in some operations, and then proceed with next result set.
15 12 * * * wget 127.0.0.1/~home/scripts/update_daily/item1 >/dev/null 2>&1
15 12 * * * sleep 30; wget 127.0.0.1/~home/scripts/update_daily/item2 >/dev/null 2>&1
16 12 * * * wget 127.0.0.1/~home/scripts/update_daily/item3 >/dev/null 2>&1
16 12 * * * sleep 30; wget 127.0.0.1/~home/scripts/update_daily/item4 >/dev/null 2>&1
55 12 * * * wget 127.0.0.1/~home/scripts/update_daily/item234 >/dev/null 2>&1
4. Group multiple Items and put in a batch file, but the unable to run the program for each item.
Before even considering this question, I would urge you to re-examine the structure of your database. If you have 100 tables with the same structure (?), each one representing a different category, it would be MUCH simpler to have a single table with an additional
category column that you could then use to query the relevant rows.
Since you don't show the code you described it's difficult for anyone to say what you might have been doing wrong, since all we know is that the things you have tried "don't work".