Informix 14.10 and later
Informix 14.10 (released in March 2019) added support for the WITH statement (Common Table Expressions).
Informix 12.10 and earlier
The documentation for the Informix SELECT statement in Informix 12.10 (which was the latest when this question was asked) does not include the WITH clause because the server does not support the WITH clause and common table expressions (CTEs) — a grievous omission, but nevertheless a fact of life.
For your specific example, you could use:
SELECT locationnames
FROM (SELECT * FROM TABLE(LIST{'abc','xyz'})(locationnames));
which would yield:
abc
xyz
though the sub-query isn't necessary here, of course (you could simply use SELECT * FROM TABLE(LIST{'abc','xyz'})(locationnames)
to get the same result). In general, though, you'll have to write out each reference to a CTE in full, with the consequential risk that the optimizer doesn't spot the commonality and therefore doesn't optimize as well as it might if it could.
WITH
sintaxe, used for CTE's. Maybe similar results can be obtained with derived tables or usingCONNECT BY
?