cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

SQL Statement Using like [[parameter]]

johnalo
4-Participant

SQL Statement Using like [[parameter]]

I am trying to pass an input parameter to a SQL statement using the like command. I cannot figure out how to write the statement using like.

Example

Select * from xxx where column like '%abc%' is what works.

If I pass an input value, how do I structure the statement:

Select * from xxx where column like '%[[parameter]]%' does not work.

Thanks

1 REPLY 1
adam11
5-Regular Member
(To:johnalo)

Hi John,

My guess is Sabarish already spoke with you, but to concatenate two wildcards to the beginning and end of your input, you can use the '||' operator. For example,


SELECT * from xx WHERE column LIKE '%' || [[input]] || '%'


Thanks,

Adam



Top Tags