FIRST and INTO clauses with 7.3 SELECT
Posted in 1999
Topics: Server Administration, Platform-Specific Issues, Versions, Editions & End-of-Life
Gurus,
I am running IDS 7.30.UC6X1 on Solaris. I was doing some ad hoc queries
in dbaccess. I entered the following SQL,
SELECT first 500 mobile_id, esn, world_number, subscriber_iid
FROM ama_19990901
WHERE mobile_id matches '[2-9]*'
INTO TEMP mytemp;
It balked. It returns an error message "944: Cannot use "first" in this
context."
My 7.3 manual(Feb 98) says that FIRST can be used with a select, as can INTO. I
can also use either one without the other with no problem. However, when used
together this error results. I checked the 7.2 and earlier manuals. There is
no mention of the FIRST clause with SELECT(only FETCH). I usually use PERL for
my code and rarely use SQL, so I'm no expert on SQL releases.
Has anyone seen this? Is this a bug?
Paul Storm
Informix does not permit things like ORDER BY or FIRST clauses when selecting
INTO TEMP.... You have to select all matching rows into the
TEMP table then SELECT FIRST 500 from the temp table.
Also FIRST is a 7.30+ extension not available in 7.2x or earlier.
Art S. Kagel
Paul Storm wrote:
>
> Gurus,
>
> I am running IDS 7.30.UC6X1 on Solaris. I was doing some ad hoc queries
> in dbaccess. I entered the following SQL,
>
> SELECT first 500 mobile_id, esn, world_number, subscriber_iid
> FROM ama_19990901
> WHERE mobile_id matches '[2-9]*'
> INTO TEMP mytemp;>
> It balked. It returns an error message "944: Cannot use "first" in this
> context."
>
> My 7.3 manual(Feb 98) says that FIRST can be used with a select, as can INTO. I
> can also use either one without the other with no problem. However, when used
> together this error results. I checked the 7.2 and earlier manuals. There is
> no mention of the FIRST clause with SELECT(only FETCH). I usually use PERL for
> my code and rarely use SQL, so I'm no expert on SQL releases.
>
> Has anyone seen this? Is this a bug?
>
> Paul Storm