MySQL EventSchedule hint ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MySQL EventSchedule hint ?

JPK @E SYSTEMES
Hi list,

In one of our web site, we run a process through a schedule event with the Event_Schedule tag :    
---
Event_Schedule:    
        -URL=$URL_schedule,
        -Start=(Action_param:'date_programmation'),
        -Restart=True;
---
Where date 'date_programmation' format is -DateFormat='%Y-%m-%d %H:%M:%S' and URL is the URL of execution sccript.


User may cancel action, we run in case a deletion of the schedule event with an inline :
---
inline: -database='site',
        -table='schedule',
        -username=username,
        -password='password',
        -keyfield='id',
        -keyvalue= #id_schedule ,
        -delete;
/inline;
---

That works fine.

In the interface, we want to allow user to change execution date of the event.
The idea is to change the date in the event with a SQL request.

These are fieds of the schedule table in lasso admin
id, date_time_start, date_time_end, next_execute, executeAction, repeat, restart, delay, user, pass

The actual records looks like (from an SQL Statement in lasso Admin)
50 2018-04-20 23:00:00 3001-01-01 00:00:00 2018-04-20 23:00:00 http://URL_AND_PARAMS        0 1 0

And the inline :
where local : 'newDateProg' = (Date_Format: (Date_GetCurrentDate), -DateFormat='%Y-%m-%d %H:00:00');
----
inline:-database='site',
        -table='schedule',
        -username=username,
        -password='password',
        -SQL='UPDATE schedule SET date_time_start = "'STRING(#newDateProg)'", next_execute ="'STRING(#newDateProg)'" WHERE id="'INTEGER(#scheduleId)'"';
/inline;
----

Date is modified in the record as expected, but the schedule event never run...
To have it run, we have to manually post the date in the edit form of the event in the lasso admin interface...

Have you an idea of what is wrong in the SQL request of the inline ?
As I know, LassoAdmin DB are SQL Lite, but maybe should I only change date in "next_execute" field ?

(Lasso 8.6, CentOS)

Regards
JPK @E SYSTEMES [Lille / France]