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.
pretzel asked why a singleton SELECT FIRST 1 with ORDER BY is forbidden in an SPL. Joe Plugge said it works without ORDER BY and otherwise needs wrapping in a FOREACH. Jonathan Leffler relayed that it is a bug and advised opening a case with Tech Support. pretzel already knew the workaround and was just curious.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
The following is a singleton SELECT:
"SELECT FIRST 1 blah blah ORDER BY blah blah;"
Why is it forbidden in an SPL?
Curious,
DG
↪ replying to pretzel
Plugge, Joe R. — — source: Usenet: comp.databases.informix
You can do the singleton SELECT if you do not have the ORDER BY clause. If you need the ORDER BY clause then you have to wrap it in a FOREACH:
FOREACH
SELECT FIRST 1 blah blah ORDER BY blah blah
END FOREACH
-----Original Message-----
From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of pretzel
Sent: Wednesday, September 28, 2011 12:42 PM
To: informix-list@iiug.org
Subject: "SELECT FIRST 1" in SPL
The following is a singleton SELECT:
"SELECT FIRST 1 blah blah ORDER BY blah blah;"
Why is it forbidden in an SPL?
Curious,
DG
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
On Wed, Sep 28, 2011 at 10:41, pretzel <davidegrove@gmail.com> wrote:
> The following is a singleton SELECT:
>
> "SELECT FIRST 1 blah blah ORDER BY blah blah;"
>
> Why is it forbidden in an SPL?
>
> Curious,
>
I asked he who knows about such issues, and his response was:
It's a bug. Please ask them to open a case...
I assume this is not a show-stopper but just a nuisancy discrepancy -- is
that fair? That won't stop it being fixed, but may alter its
prioritization. You can discuss that with Tech Support when you open the
case.
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
Thank you Joe and Jonathan.
Yes, I realized the work-around. I was just being anal and curious,
as is my wont.
I supposed it might have been a bug that no one ever got around to
fixing because there is an easy work around, and, therefore, many
other things of greater import.
Thanks again.
DG
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.