Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
David Kosenko — — source: Informix-list mailing list archive (1991-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
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.