Building a request using schema name selected in a variable

  • With Grafana 9.4

  • I use a variable to select the schema name for my request

  • trieed this

select * from $_schema.mv_test_one


select * from ${schema:sqlstring}.mv_test_one

  • it is not working

  • I was expecting the request was able to use the variable


What is the datasource?

Well, at the moment this post is in the topic PostgreSQL, what is your guess?

1 Like

I would go with dynamic sqlnwith exec statement

Ha, waste too much time on it…

It is as simple as:

select * from ${schema}.mv_test_one 

where schema is the variable name.

1 Like