I am having an issue with a report that has two 'Select Lists' populating via parameter queries. The queries follow the standard documentation for a basic and connected parameter. The first parameter performs a company lookup:
select 0, 'All'
union
select companyid, name
from company
The second is a stored procedure that pulls location based on company id:
CREATE DEFINER=Reports
@%
PROCEDURE sp_ADBR_GetCompanyLocations
(
company_id INT
)
BEGIN
SELECT 0, 'All'
UNION
SELECT locationid
, name
FROM locations
WHERE companyid
= ccompany_id;
END$$
Generally speaking, the menus/parameters work without issue. However, there are some companies that when I choose them, I get a spinning circle at the top of the page and the location never populates. It seems that the issue occurs on companies that have more than 4 or 5 locations. If I select a different company (one with fewer locations) while the wheel is still spinning, it will populate the location menu. If I switch back to the company that won't load locations, it will retain the location list from the previously loaded company. I tested the procedure in the SQL editor, adding in the company ID as the company_id parameter, and all the locations load (7 rows, including the select 0, 'All')
My workaround:
However, if I just run the report with the non-working company and the location set to 'All', I can view and change the location from within the report settings menu
That all being said, has anyone else had this issue? Is it a known issue? Is there a better workaround? Some sort of timeout that I am hitting? The query finishes in 0.05 seconds when I run it from SQL editor.
Thanks in advance.