HomeGeneral Q & A

Using Wildcards in a Parameterized Queries Messages in this topic - RSS add reply

Guest


2/8/2019
Guest
Hello,

I am trying to use SQL "like" command in a Parameterized SQL Query, but can't return any result. I need to create a query like below.

select * from Customer where customer_name like '%@customer_name%'

Thank in advance.
0 mark as "accepted answer" link reply with quote
kenan@decisions.com
kenan@decisions.com
Administrator
Posts: 251


2/8/2019
kenan@decisions.com
kenan@decisions.com
Administrator
Posts: 251
Hi,

You have to define wildcard characters inside of your parameter edit menu. For more information please use attached screenshots for your reference.

Regards,




edited by Kenan on 2/8/2019

0 mark as "accepted answer" link reply with quote
sinh@decisions.com
sinh@decisions.com
Administrator
Posts: 17


3/9/2021
sinh@decisions.com
sinh@decisions.com
Administrator
Posts: 17
Adding onto Kenan's reply on Parameterized Queries and providing useful documentation as well that you can reference further for the subject:
Parameterized Queries
Fetch Entities Criteria and SQL Equivalence



Both will allow you to use a customizable query to retrieve a result. Fetch entity steps are easier to implement, but will grab the entire object it is querying by default if you ever want to use this option. You can use the contains options on the Fetch Entities step to replicate a simple wildcard like behaviour. It's easy from there to trim down what you may need from your list of results, such as when selecting the list of the object from the flow, selecting First, and then selecting the specific column you wanted to map into a result variable you have in your flow if you only want the first result retrieved from this query. Parametrized SQL queries will of course have the most customization of exactly what you want to get as a result from your query, such as grabbing only a specific column, or if you want a stricter wildcard parameter.

As an extra note, you cannot test parameterized queries within the Query Editor; it's meant to be used only for simple queries so you need to test with those two options provided above.
0 mark as "accepted answer" link reply with quote


(Ctrl+Enter)




Powered by Jitbit Forum 8.3.8.0 © 2006-2013 Jitbit Software