Skip to main content
Nintex Community Menu Bar

Use IN Operator Within SQL Predefined Query

  • August 31, 2022
  • 0 replies
  • 21 views

MillaZ
Nintex Employee
Forum|alt.badge.img+23
Product: Kryon RPA
Product Version: Any Version
Components: Kryon Studio
Prerequisites: None.
Symptom:

If you need to run a query using IN operator the query will not return any results.


Example table:

 

24043iD49EEDED7FA04A08.jpg

 

Example query:
 

SELECT [AppID],[AppName] FROM [Leo].[dbo].[LeoApplications] WHERE [AppID] IN ($ListOfAppID$)

 

When using SQL Custom Query, the command will produce a result but using SQL Predefined Query will not. 
 

Cause: TBD
Resolution: N/A
Workaround:

To use predefined values when writing a query, use the following format:
 

SELECT [AppID],[AppName] FROM [Leo].[dbo].[LeoApplications] Where CHARINDEX('~'+CAST([AppID] AS VARCHAR)+'~',$ListOfAppID$)>0
24044i50288C152EF75027.jpg
 
More Information: If you are using Oracle, you can use the following format: 
 
SELECT AppID,AppName FROM table_name Where INSTR('~' || to_char(AppID) || '~',$ListOfAppID$)>0