Data Infrastructure Management Software Discussions

correct syntax for query using LIKE with predefined variable?

stephen2
views-count 1896 Views

trying to use like in a query referencing a predefined variable and cant get the syntax right.

SELECT v.name AS VolumeName

  FROM cm_storage.volume v, cm_storage.cluster c, cm_storage.vserver vs

WHERE     (c.id = vs.cluster_id)

       AND (vs.id = v.vserver_id)

       and v.name like '${LastVol}'

       order by v.name desc

limit 1

Anyone know if this can be done, and if so, what the syntax is?

3 REPLIES 3

Re: correct syntax for query using LIKE with predefined variable?

ag
NetApp
views-count 1897 Views

Hi Stephen,

That is the correct syntax. It is working for me.

What kind of error is being thrown, if any?

Re: correct syntax for query using LIKE with predefined variable?

abhit
views-count 1897 Views

Hi Stephen:


Where are you using/testing this query? In WFA or using it outside WFA?

If you are using in WFA which version of WFA are you using?

As 'ag' replied, it is syntactically correct, WFA is not complaining.

If using WFA, are you trying to use it in a user input query or you are using in a filter?

Regards

Abhi

Re: correct syntax for query using LIKE with predefined variable?

stephen2
views-count 1897 Views

Hey guys, it must have been something stupid. I tried in another workflow and the syntax worked correctly

G2 Review Banner
All Community Forums
Public