Re: Selecting item from LIST type in 9.14
Posted in 1998
eweaver@my-dejanews.com offerred: +Does anyone know how to select a single item from a LIST column? I +searched every manual I can find. Informix hints that it can be done +but I have not found the syntax and have not guessed correctly either. + +GIVEN a table like this: + +CREATE TABLE foo +(foo_id int; + foo_list LIST(integer not null) +); + +How can I select the second element of foo_list where foo_id=2 ? You can't. At least not in SQL. According to the SQL Tutorial v9.1, pg 12-14: "The only way to select...individual elements in a collection is through an external or SPL routine." A LIST is just one type of collection. Dave ** Dave Kosenko <davek@summitdata.com> ** Director of Training Services (732) 469-4070 ** Summit Data Group (an Informix Authorized Education Center) ** Find my advice useful? Let me teach you everything I know about ** Informix. Sign up for OFFICIAL Informix training at SDG. ** For details, see http://www.summitdata.com/training