I'm creating a MySQL Script that runs on a record and pulls associated records from a series of other tables, which is super useful but in DBeaver the results come back as tabs that only have the name of the table the results come from, which is very useful but sometimes having the tab display exactly what the result is would be so much more useful.
Is there a way to specify in the SQL script what the result should be named that is picked up by DBeaver so it gets displayed as the tab name?
In DBeaver, if I execute the following script (Opt+X):
SELECT *
FROM
partnerships;
SELECT id, name, owner_id
FROM
partnerships
WHERE
name LIKE '%wp%';
The results for both queries come up in two different tabs at the bottom of the DBeaver screen, one would be named partnerships
and the other partnerships-1
. What I'm asking is, if there is a way to make those tabs something more meaningful to me, like All Partnerships
and WP Partnerships
.
Turns out, you can actually define the title with a SQL comment in front of the query. Such as:
-- title: WP Named Partnerships
SELECT id, name, owner_id
FROM
partnerships
WHERE
name LIKE '%wp%';
This will make it so that WP Named Partnerships
will be the title of the results tab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With