Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 4 of 4 total |
How to use IN in a query with params |
Tue, Oct 17 2017 11:44 PM | Permanent Link |
Paul Coshott | Hi All,
I want to implement a compare feature for items in a table. Each item has an ItemId (integer). I created the following query: Select * From Items where ItemId IN ({ItemId=1,2}) I have tried a few slightly different formats, but can't figure out how to create a query that allows params for use with IN, so I can add a few items. Any idea how to do this, or is there a better way to do what I want to accomplish? Cheers, Paul |
Wed, Oct 18 2017 1:59 AM | Permanent Link |
Jiri Dvorsky | See
https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_server&page=1&msg=81#81 ------------------------------------------------------------------------------------------------------------------------------------------------ Paul Coshott wrote: Hi All, I want to implement a compare feature for items in a table. Each item has an ItemId (integer). I created the following query: Select * From Items where ItemId IN ({ItemId=1,2}) I have tried a few slightly different formats, but can't figure out how to create a query that allows params for use with IN, so I can add a few items. Any idea how to do this, or is there a better way to do what I want to accomplish? Cheers, Paul |
Wed, Oct 18 2017 3:11 AM | Permanent Link |
Uli Becker | Paul,
> Any idea how to do this, or is there a better way to do what I want to accomplish? As Jiri indicated, it's not possible this way. As a workaround you could write the ID's you want to compare in a separate table (TempTable) and use a query like this: SELECT * FROM Items WHERE ItemId IN (SELECT ItemID FROM TempTable); Another (clean) way to get what you want is to use a module and pass the ID's either as separate params or as a list. Cheers Uli |
Wed, Oct 18 2017 8:19 AM | Permanent Link |
Paul Coshott | Hi Guys,
Thanks for the help. I think a module would be best, as ultimately I want to return a pdf report anyway. Thanks, Paul >>Another (clean) way to get what you want is to use a module and pass the >>ID's either as separate params or as a list. |
This web page was last updated on Thursday, March 28, 2024 at 08:36 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |