Re: Why can't this work? (select first N into temp t1)
Posted in 2000
"Informix Guide to SQL: Syntax":
Restrictions on the First Clause:
The FIRST clause is not allowed in the following situations:
# .................................
# When your SELECT statement is selecting data and inserting it into another
table, such as a temporary, scratch, or external table;
# .................................
Best regards,
Danail
----- Original Message -----
From: Ernst Sauerwein <ernst@mb184060.mch.sni.de>
To: <informix-list@iiug.org>
Sent: Thursday, July 20, 2000 3:26 PM
Subject: Re: Why can't this work? (select first N into temp t1)
> This is a multi-part message in MIME format.
> --------------24BC0DBC3878F5C3C9E319CC
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: 8bit
>
>
>
> Zandy wrote:
>
> > IDS 7.31 UC6 on Solaris
> >
> > hi all!
> >
> > SQL: select first N into temp temp1
> >
>
> Hi,
> I suppose N means a number.
> Try
> select first N * from table_1 ...
> or
> select first N col_1 from table_1>
> You have to specify the column[s] for the select.
> It works fine with 7.31 and 9.21 (maybe 9.20 too).
>
> >
> > I was wondering if someone could provide me a logical
> > explanation as to why this isn't possible.
> >
> > I'm gettting a 944 error saying:
> >
> > "Cannot use "first" in this context.
> > This statement uses FIRST N inside a subquery. This action is
> > not supported.
> > Review the use of FIRST N and check that it is applied only to
> > the outer main query SELECT clause."
> >
> > Thanks,
> > Lyzander
> >
> > -----------------------------------------------------------
> >
> > Got questions? Get answers over the phone at Keen.com.
> > Up to 100 minutes free!
> > http://www.keen.com
>
> --
> Mit freundlichen Gr''en / with best regards :-)
> +===================================Mail-Client: Netscape V4.73=+
> | Ernst Sauerwein Siemens Busines Service |
> | =============== IT Services ISC-D 144 |
> | Microsoft Certified OLTP-Systems |
> | Professional INFORMIX' Database Support |
> | Tel: +49 89 3601 2699 Area South Europe |
> | FAX: +49 89 3601 2402 Berliner Str.95,III/D046 |
> | EMAIL: mailto:ernst.sauerwein@mch.siemens.de |
> | FTP: ftp://ftp.siemens.de/ (external) |
> | ftp://MB184060.mch.sni.de/ (internal) |
> | WWW: http://its.mch.sni.de/ (external) |
> | http://MB184060.mch.sni.de/ (internal) (v private) |
> | http://www.stud.uni-muenchen.de/~yaling.mo/Welcome.htm |
> +===============================================================+
>
>
> --------------24BC0DBC3878F5C3C9E319CC
> Content-Type: text/x-vcard; charset=us-ascii;
> name="ernst.vcf"
> Content-Transfer-Encoding: 7bit
> Content-Description: Card for Ernst Sauerwein
> Content-Disposition: attachment;
> filename="ernst.vcf"
>
> begin:vcard
> n:Sauerwein;Ernst
> x-mozilla-html:FALSE
> url:http://www.siemens.de
> org:SBS;ITS ISC-D 144
> adr:;;Berliner Stra'e 95;M'nchen;;81739;D
> version:2.1
> email;internet:ernst.sauerwein@mch.siemens.de
> fn:Sauerwein, Ernst
> end:vcard
>
> --------------24BC0DBC3878F5C3C9E319CC--
>