Grafana variable section show preview of values although query is wrong - grafana

I have a grafana dashboard. In this dashboard i created a variable. The sql query is wrong.
My datasource is : ansdatabase
wrong query : select client from ansdatabase
Right query : select client from clienttable
Strange thing is. When i open variables page and write wrong query and save it. Below page shows preview of values. But there shouldnt be any values there. Also page throws an error that it couldnt find ansdatabase table. It is normal because ansdatabase is not a table name.

You must have done the right query before (select client from clienttable) correct? Grafana keeps the values from the last valid query.

Related

Tables are empty in Query Builder when Saved SQL script is retrieved

I saved a query I created in the SQL Developer Query Builder.
When I retrieved the query, the linked Tables don't show the Column Names in the Query Builder.
The Tables are still linked/joined to one another and the query still runs, but the columns names are blank.
How do I get the Column Name to reappear?
I'm new to SQL Developer, so I'm not sure how to resolve this issue.
Any help would be greatly appreciated.
Searched through the menus for something that would restore the columns names.
Searched through help option on SQL Developers and nothing found relating to this issue.
I was very tempted to delete this post when I found the answer myself.
However, I think there are more rookies out there like me.
The resolution is to add a semi-colon ";" to the end of the statement in the Worksheet Tab.
Even though I created the query in the Query Builder Tab, SQL Developer creates the SQL Statement in the Worksheet Tab.
So for some reason after you save that Query that was created in the Query Builder Tab; when you retrieve the script, you must add ";" to the end of the SQL Statement in the Worksheet Tab or else you get the issue I encountered with the blank columns.

Azure Postgres & Query Performance Insight: Query text not showing

I have enabled Query Performance Insights, however, the Query Text fields are left empty, as you can see from the screenshot below.
I have enabled the Query Store as described in the documentation, everything else has been left to its default values.
pg_qs.query_capture_mode is set to TOP
pgms_wait_sampling.query_capture_mode is set to ALL
If I query the query_store.qs_view or pgms_wait_sampling_view data is returned.
SELECT * FROM query_store.qs_view;
SELECT * FROM query_store.pgms_wait_sampling_view;
Also the column qs_view.query_sql_text contains SQL statements, as well as the query_texts_view. Any idea why its not showing up in the UI?
In the portal page of your Azure Database for PostgreSQL server, select Query performance Insight under the Intelligent Performance section of the menu bar. Query Text is no longer supported is shown. However, the query text can still be viewed by connecting to azure_sys and querying 'query_store.query_texts_view'.
https://learn.microsoft.com/en-us/azure/postgresql/concepts-query-performance-insight

How do I add a filter by a tag in grafana?

I feel like I'm trying to do something incredibly simple, but I just can't find any cogent explanation anywhere on the internet after an hour of searching.
I'm using InfluxDB/Grafana and I have a DB with several tables. My tables have a tag key named "host" so that I can tell which server the data is coming from.
I want to create a dropdown on my dashboard so that I can select which host's data is displaying on the panels. Is there any way to do this?
Create dashboard variable from the query
SHOW TAG VALUES WITH KEY = "host"
and use it in the panel query. It is documented in the Grafana doc:
https://grafana.com/docs/grafana/latest/features/datasources/influxdb/#templating

Using LIKE with parameter expression in query

I was trying to using the like function in iReport 4.0.1. Checked online but none seem to work.
Currently trying to use:
where name LIKE'%$P!{px_name}%'
also tried
'%$P{px_name}%'
but when running the report it comes up saying 'No document'.
But when using where name =$P{px_name} it works perfectly fine.
Where clause will be same as you have used in first step which is :-
where name LIKE '%$P!{px_name}%'
But as you said report says 'The document has no pages' means the query is returning 0 row so just use the same string in LIKE and run the same query in database. Simplest solution is first run the query in database with LIKE operator , if it returns the rows in database then that should also work in iReport.

Using Select query, nothing merges onto Crystal report

I have a Crystal template that I am modifying in developer because we are changing the datasource from an Access file to our Oracle DB. I created a database field that accurately connects to Oracle and added a select statement that because pulls a field from a particular table
select s.field from table s;
On the right hand side, under database fields, I see my command and can right click and browse the data, which right now returns two values.
I also made a formula field using an Azalea barcode function that calls the values (I think, this is where stuff is going wrong, I guess)
The formula field is
BarcodeC39ASCII({Command.field})
So this should take the data and format it into the barcode, except when I use print preview or print out the report, no data is merged.
I've tested this by creating a new formula field with just the Command.field, and still no data is merged. I imagine there is something really obvious that I am missing and would appreciate any input.
So unless I misunderstood your question, you are changing your datasource from Access DB to Oracle DB, correct? Assuming that the database structure remains the same then all you should need to do is go into Database -> Set Datasource Location and set the datasource location from the Access DB to the Oracle DB and your existing report should work as it did. You might have to map some fields, but that should be the extend of it. Is that what you are trying to do?
Chris