Re: Selecting item from LIST type in 9.14
Posted in 1998
Topics: Stored Procedures & SPL, Data Types & Schema Design
Yes, I am aware of what the manuals say. I guess my gripe is that the only
way to select individual items from a collection is to use SPL ?!?! That's
ridiculous. Of course, even the Chapter 14 info is about a paragraph long
with no working example of how to do it - totally vague and almost useless.
If thats the only way to select items then why didn't informix write and
provide access functions for these data types? By the way, the Illustra
implementation was great!
Eric Weaver
In article <35B19654.58A09CF3@telegate.co.il>,
Avi Abrami <avia@telegate.co.il> wrote:
> 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
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum