This topic is locked

Automate a query without using data selection in the search panel with PHPRunner10.8

2/15/2023 7:22:03 AM
PHPRunner General questions
konenamogo author

how can I automate a task from a given date? I have a client who wants to process records for the current week without making a data selection.
Example:
Today's date = 02/15/2023 .
He wishes to automate the processing of the week, i.e. where date between 02/13/2023 and 02/17/2023.
Are there any functions to do this?
How can we process this type of automatic query without using data selection in the search panel ?

Dalkeith 2/15/2023

No idea if this is optimal or not I hope someone might have an easier way. but this is a recursive option that has worked for me in the past...

In some databases you can write stored procedures that create or alter views..based on parameters.

And of course in phprunner you can pass parameters to stored procedures.

So you can
1)Create a table of the parameters that you wish to alter
2)Create a stored procedure that creates or alters a view based on parameters
3)Create a button in PHPRunner that passes the parameters from 1) to the stored procedure in 2) that then alters the filter of the view
4)Have a button or buttons that show the view

You do need to structure the database in a particular way

So for example
List of charges on a nightly basis
You want to have several forms that just show the charges for certain months or weeks as per yours.

Here's an explanation I wrote to myself (SQLServer example)
https://cloudydatablog.net/?p=3495

This thread looks like it is another way of doing the same thing (mysql example)
https://asprunner.com/forums/topic/29656-Populate-Report-With-SQL-View-Procedure

Sergey Kornilov admin 2/18/2023

If you need to automate something, PHPRunner won't help you. This is a job for a custom PHP script that you can schedule to run on a timely fashion. PHPRunner apps will only work when some opens them manually in the web browser.