SQL Query with Parameters

LabKey Support Forum (Inactive)
SQL Query with Parameters Jon (LabKey DevOps)  2018-03-09 14:43
Status: Closed
 
Hi Marcia,

Have you taken the time to review our robust Support Documentation?

https://www.labkey.org/Documentation/wiki-page.view?name=default

Many of your questions can be answered in our docs and we even have videos to help you understand how to both use LabKey and understand the functionality:

https://www.labkey.org/Documentation/wiki-page.view?name=videos

For future, please do your best to consult our fantastic docs first before posting to the Community Forums.


Regarding your question about which version of SQL is used with LabKey, only PostgreSQL and Microsoft SQL Server are supported for use with the LabKey platform:

https://www.labkey.org/Documentation/wiki-page.view?name=supported

We can interface with other databases as an external datasource and have it appear as an External Schema on a read-only basis:

https://www.labkey.org/Documentation/wiki-page.view?name=externalSchemas

The LabKey SQL dialect itself is a pretty universal SQL dialect that does leverage some database-specific functions depending on what DB you're running off of:

https://www.labkey.org/Documentation/wiki-page.view?name=labkeysql

Regarding using the IN operator with Parameters, this is not possible since the Parameterization doesn't treat multiple values within the field as separate fields, but as one single value.

For example, putting in "abc, dge, fec" in a Parameterized field wouldn't treat it as three separate values, but rather one whole value. So it would treat it like:

WHERE fieldname IN ("abc, dge, fec")

rather than

WHERE fieldname IN ("abc", "dge", "fec")

So in order to get the desired result you want, you would need to do your filtering via your grid after the results render since the filter on the grid does allow you to filter in a variety of ways, such as "Equals One Of", "Contains One Of", and more:

https://www.labkey.org/Documentation/wiki-page.view?name=filteringExpressions
https://www.labkey.org/Documentation/wiki-page.view?name=filteringData

Regards,

Jon