Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a list of values variable for the usage in a SQL Where IN-Clause.
Companies:
LOAD * INLINE [
Company
CompanyA
CompanyB
CompanyC
];
List:
LOAD
concat(Company,chr(39)&','&chr(39)) as AllCompanies
resident Companies;
LET vList = chr(39)& peek('AllCompanies') & chr(39);
// Sample SQL Select Statement:
SQL SELECT * FROM company WHERE name IN ($(vList));
@marcelo-7

This comment has been minimized.

Copy link

@marcelo-7 marcelo-7 commented Dec 11, 2013

Alternative to peek:
LET vList = FieldValue('AllCompanies', 1);

Thanks!

@ralfbecher

This comment has been minimized.

Copy link
Owner Author

@ralfbecher ralfbecher commented Feb 6, 2018

Well, FieldValue() shouldn't be faster or better in this case of one row..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.