Hi, can anyone help me with the problem below. I have a mysql database with a table that is frequently updated by multiple users. In the table are the columns (id, actiontype, action, datestarted, timetaken) I call the esql to grab the data and if the current time is past the datestarted+timetaken a number of processes are invoked eg. Check actiontype and action and perform certain operation. The trouble is that if there is more than one action that needs updating this also needs to be done. I can't figure out how to incorporate this in esql.
This is what I have currently <normal databse connection> <!-- count the number of actions ready for updating --> <esql:query>select count(*) as count, from actions where name='<xsp-session:get-attribute name="planetname"/>'</esql:query> <esql:results> <esql:row-results> <xsp:logic>processes = <esql:get-int column="count"/>;</xsp:logic> </esql:row-results> </esql:results> <esql:no-results> <xsp:logic>processes =0;</xsp:logic> </esql:no-results> <esql:execute-query> </normal databse connection><!-- =================== --> <normal databse connection> <!-- launch a for loop so that the actions can be processed. --> for (int counter=0; processes <= counter; process++) { <esql:execute-query> <esql:query>select * from actions where player='<xsp-session:get-attribute name="planetname"/>'</esql:query> <esql:results> <esql:row-results> <xsp:logic> check the actiontype and action and if it is has served its time. If it has process it if not continue</xsp:logic> <esql:row-results> </esql:results> </esql:execute-query> </normal databse connection> <!-- ================== --> Unfortunately I have realised that each time the for loop increments that if an action has not served its time it will continue to be processed in the next increment of the loop. Hence processes after it in the table will not be processed. Is there a way around this using java logic, esql or sql command? Thanks Sharat --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>