Active IQ Unified Manager Discussions

Use a constant in a SQL Query

slair

I have a User Input Variable that shows a list of snapshots for a volume based off of a SQL query.  I also have defined a Constant that contains the name of the volume we need a list of snapshots for.  I am using a Constant because the end user should not be able to select another volume.  How can i reference the constant in the SQL Query?  I can reference a User Input Variable using the following, but how to I reference the constant?

SELECT snapshot.name

FROM storage.snapshot, storage.volume

WHERE

          volume_id = volume.id

          AND volume.name = ${source_volume}

I want to put a contant in place for ${source_volume}.  I know i could just do 'myVolumeName' but I'd rather reference my already defined constant

Thanks

Sean

1 ACCEPTED SOLUTION

shailaja

Hi Sean,

Currently, it is not possible for the SQL query to reference the constant defined in the workflow.

For the scenario mentioned above, can you have a different user input like $Volume which is defined with the default value as the volume name that you would like

or as a locked Enum which has just one enum value (the hard-coded name of the volume). You could show  that in the workflow and then the snapshot query can reference the volume name like above. Will that work for you ?

Thanks,

Shailaja

View solution in original post

1 REPLY 1

shailaja

Hi Sean,

Currently, it is not possible for the SQL query to reference the constant defined in the workflow.

For the scenario mentioned above, can you have a different user input like $Volume which is defined with the default value as the volume name that you would like

or as a locked Enum which has just one enum value (the hard-coded name of the volume). You could show  that in the workflow and then the snapshot query can reference the volume name like above. Will that work for you ?

Thanks,

Shailaja

View solution in original post

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public