SELECT ....... FROM application_table FETCH FIRST 1 ROWS ONLY ??

Georg Peter

SELECT ....... FROM application_table FETCH FIRST 1 ROWS ONLY ??
Collegues,

in one of our applications we use some "non-self-written" program parts.
Today the vendor of this programm parts gives us a patch with the following
patch/statement:

SELECT col1, col2,.....
FROM application_table FETCH FIRST 1 ROWS ONLY


This ends in an SQLCODE -199, ERROR: ILLEGAL USE OF KEYWORD FETCH, TOKEN
FOR WITH ORDER UNION EXCEPT QUERYNO OPTIMIZE WAS EXPECTED

Our environment is DB2 for OS/390 Version 6. Is it possible that the
statement above works in a non-390-environment, but not in the DB2 for
OS/390 Version 6 arena ?

Or is it a statement that works only in DB2 for z/OS V7 or V8 ?


Any comments, thoughts, experiences are highly appreciated. Thanks in
advance.

With kind regards - mit freundlichen Gruessen,
Georg H. Peter c/o
-------------------------------------------------------------------
Datenzentrale Baden-Wuerttemberg
Software Development & Technology Center
Knowledge Center Database Systems
Krailenshaldenstrasse 44, 70469 Stuttgart, Germany, Europe
e:mail [login to unmask email]
Phone 0049-711-8108-271
PC-Fax 004971189696071
Internet (only in german language):http://www.dzbw.de
----------------------------------------------------------------------
"Every action is a p o s i t i v e action, even if it has a negative
result."

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Chris Tee

Re: SELECT ....... FROM application_table FETCH FIRST 1 ROWS ONLY ??
(in response to Georg Peter)
Georg

FETCH FIRST is valid in V7 onwards. (You'll have to upgrade!!)

Chris

-----Original Message-----
From: Peter, Georg [mailto:[login to unmask email]
Sent: Monday, January 10, 2005 12:56 PM
To: [login to unmask email]
Subject: [DB2-L] SELECT ....... FROM application_table FETCH FIRST 1
ROWS ONLY ??



Collegues,

in one of our applications we use some "non-self-written" program parts.
Today the vendor of this programm parts gives us a patch with the following
patch/statement:

SELECT col1, col2,.....
FROM application_table FETCH FIRST 1 ROWS ONLY


This ends in an SQLCODE -199, ERROR: ILLEGAL USE OF KEYWORD FETCH, TOKEN
FOR WITH ORDER UNION EXCEPT QUERYNO OPTIMIZE WAS EXPECTED

Our environment is DB2 for OS/390 Version 6. Is it possible that the
statement above works in a non-390-environment, but not in the DB2 for
OS/390 Version 6 arena ?

Or is it a statement that works only in DB2 for z/OS V7 or V8 ?


Any comments, thoughts, experiences are highly appreciated. Thanks in
advance.

With kind regards - mit freundlichen Gruessen,
Georg H. Peter c/o
-------------------------------------------------------------------
Datenzentrale Baden-Wuerttemberg
Software Development & Technology Center
Knowledge Center Database Systems
Krailenshaldenstrasse 44, 70469 Stuttgart, Germany, Europe
e:mail [login to unmask email]
Phone 0049-711-8108-271
PC-Fax 004971189696071
Internet (only in german language):http://www.dzbw.de
----------------------------------------------------------------------
"Every action is a p o s i t i v e action, even if it has a negative
result."

----------------------------------------------------------------------------
-----
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
"Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org.
The IDUG List Admins can be reached at [login to unmask email] Find
out the latest on IDUG conferences at http://conferences.idug.org/index.cfm


***********************************************************************************************
The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only.

This mail or any response may be monitored by Sony United Kingdom Limited. (6)
***********************************************************************************************

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm