google-code-export / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

SELECT FOR FETCH ONLY not working in DB2 Mode #305

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SELECT FOR FETCH ONLY not working in DB2 Mode.

Our production database is DB2 and we are using h2 for unit testing. The DBA 
team wanted us to append "FOR FETCH ONLY" for some select queries. However, the 
query is failing in h2 database.

Query: 
SELECT col1, col2 FROM table1 FOR FETCH ONLY.

Error: 
Syntax error in SQL statement "SELECT col1, col2 FROM table1  FOR FETCH[*] ONLY 
"; SQL statement:
SELECT col1, col2 FROM table1  for fetch only [42000-147] {SELECT col1, col2 
FROM table1  for fetch only} [code=42000, state=42000]; 

Expected Output:
Successful execution of query

Operating System:
Windows XP

h2 Version: 
1.2.147

WorkAround:
Trim off FOR FETCH ONLY for test

Use Case:
Suggestion from DBA; feature supported in DB2.

Priority:
High

Original issue reported on code.google.com by sud...@gmail.com on 22 Mar 2011 at 7:04

GoogleCodeExporter commented 9 years ago
Fixed in revision 4721

Original comment by noelgrandin on 3 Apr 2013 at 3:43