Question
· Mar 26, 2021

access %List property from sql

Hi,

is it possible to access a property defined as %List from sql? I´d like to search for a object containing a specific value in it´s %List defined property. Is there a predefined sql function for that within IRIS?

best regards,
Sebastian

Discussion (7)0
Log in or sign up to continue

I think you can accomplish this is $LISTFIND. It searches a list for a value, and returns its position in the list. If the item isn't found in the list, it will return a 0. For example, if you've got a list of colors called colorlist you'd use "where $LISTFIND(colorlist,'blue') > 0" in your SQL predicate to only include rows that have "blue" in their list. If the list contained "red", "blue", and "green" in that order, the $LISTFIND would return a 2. If the list contained "orange", "yellow", "taupe", the $LISTFIND would return a 0 because "blue" wasn't found and that row would be excluded.