Re: Selecting item from LIST type in 9.14
Posted in 1998
eweaver@my-dejanews.com wrote:
> 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 ?
>
> In Illustra, this would work:
> select foo_list[2] from foo where foo_id=2;
>
> Thanks!
> Eric Weaver, InteliHealth
> eweaver@intelihealth.com
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Dear Eric,
Look at the manual entitled "INFORMIX Guide to SQL: Tutorial",
Chapter 14 "Creating and Using SPL Routines"
Section entitled "Selecting Elements from a Collection".
This is available through the printed manual, the "Answers OnLine"
CD or the URL: http://www.informix.com/answers/
Cheers,
Avi.
************************************************************************
/\\ \\ /| Avi Abrami, Analyst/Programmer, Telegate Ltd.
/__\\ \\ / | 7 Haplada Street, Or-Yehuda, ISRAEL
/ \\ \\/ | Phone:+972-3-5388717 Fax:+972-3-5335877 eMail:avia@telegate.co.il