Can we create multiple queries and save it as a VM in dremio

I need to execute two queris with one click.
Example:- I’m trying to do remove and add reflection by the query. so first I need to remove then add

ALTER DATASET <DATASET_PATH> DROP REFLECTION <REFLECTION_NAME>;
ALTER TABLE <Source_PDS_OR_VDS_NAME>
CREATE AGGREGATE REFLECTION <reflection_name>
USING
DIMENSIONS (x by day, y)
MEASURES (b (COUNT, MIN, MAX, SUM, APPROXIMATE COUNT DISTINCT))
–PARTITION BY (col1,col2…)
–LOCALSORT BY (col1,col2…)
–ARROW CACHE
–DISTRIBUTE BY (col1,col2…);
How can I do it I tried but get this error

PARSE ERROR: Unable to parse multiple queries.

@RusiruDesilva Typically users use a JDBC query tool like DBeaver or DBVisualizer to run multiple queries

@balaji.ramaswamy is there a secret to running multiple queries in DBeaver? When I try, I get the following:

SQL Error: PARSE ERROR: Unable to parse multiple queries. First query is s. Rest of submission is select count(1) from "$scratch".factrollup;
select count(1) from "$scratch".factrollup


SQL Query select count(1) from "$scratch".factrollup;
select count(1) from "$scratch".factrollup


[Error Id: 12105015-ad60-444a-a127-9f09e92e1080 on 10.134.16.218:31010]

@jdlong Does it work if you just run one query? Also use the third icon when running multiple queries

1 Like

@balaji.ramaswamy well, I’m an idiot. I had never used DBeaver prior to this week. I had no idea it has multiple “run buttons”. Turns out it was exactly like you said… I was clicking the wrong button

for future travelers, click here: