[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

rownum error

i was trying to see first 10 rows

select  *  from vw_employee fetch first 10 rows

plz advice

DBA2191E SQL execution error.

com.ibm.db.DataException: A
database manager error occurred. : [IBM][CLI Driver][DB2/NT]
SQL0104N  An unexpected token "END-OF-STATEMENT" was found
following "e fetch first 0 rows".  Expected tokens may include:
 "ONLY".  SQLSTATE=42601


0
bobby2929
Asked:
bobby2929
1 Solution
 
db2inst1Commented:

You just missed "only"

select * from tabname fetch first 10 rows only

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Tackle projects and never again get stuck behind a technical roadblock.
Join Now