1
0
-1

why is inside the list if i place the the Database Sql Query for each for and run a code 
that code will work


but then when i place that database sql query outside 


the code won't be exuected 

just like a simple sql line for example 

delete from table 




the same exact code run in (1) but fails in (2) 

is there any reason why ??

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Hi Mohammed Tarek,

      we need more details to find the root cause, could you please provide the following details:

      • Error message from system logs when executing button (2)
      • The SQL query used in the buttons

      Waiting your response,

      Mahmood Qaid

      1. M Tarek Hamwi

        UPDATE app_fd_Machine_Listing ml
        LEFT JOIN (
            SELECT c_machine_name, COUNT(*) AS c_issue_count
            FROM app_fd_report_history
            GROUP BY c_machine_name
        ) rh ON ml.c_machine_name = rh.c_machine_name
        SET ml.c_number_of_issues = IFNULL(rh.c_issue_count, 0)
        WHERE ml.c_machine_name = rh.c_machine_name OR rh.c_machine_name IS NULL;


        this is the code 

        it work on the (1) but not on the (2)

        there is no error message from the system logs 

      2. Mahmood Qaid



        Turned out that button (B) only works when having a row selected,
        can you try selecting a row and then clicking the button?

      CommentAdd your comment...