I am using Grafana 9.3.6. And please allow me to ask again one question that many people have asked but I still can’t find out solution. I use Grafana to connect to Mariadb databases. After generating a variable, once I select “Multi-value” or “Include All Option”, the output shows “No Data”.
To solve the problem, I did the following.
-
according to the Variable syntax, I wrote the variables in various formats such as ${query0:csv}, ${query0:sql-string}, ${query0:raw}, [[query0]],[[query0:raw]] etc. Believe me, I have tried everything I found in Google and various forums.
-
I checked the Query inspector and found the reason for show “No Data” when selecting more than one item or all item is as follows:
When I select single item: The Query inspector shows:
SELECT column FROM table WHERE something IN ('a')
With single item chosen, everything goes right.
When I select multiple items. It shows:
SELECT column FROM table WHERE something IN ('a,b')
When I select multiple items, not using the Varialbe syntax. It shows:
SELECT column FROM table WHERE something IN (''a','b'')
That’s when the result “No Data” appears.
Although modifying the Varialbe syntax has removed the single quote for a single value, the problem is that there is no way to completely remove the single quote, and I have tried all methods without success. I believe the single quote is the cause of the “no data” result.
Is there a way to solve this problem completely?