View Full Version : SQLFetchResultsetValues suggestion

9-Mar-2014, 02:36 PM
It would be helpful to be able to pass a row limit to this message.

9-Mar-2014, 06:25 PM
Hi Frank,

Although on the surface this suggestion seems plausible but I do not think it is feasible.

The cSQLStatement class is used to handle Embedded SQL operations - meaning developer has a free hand on how the SQL statement is constructed and executed. Therefore, limiting the rows needs to be part of the SQL statement (ie. SELECT * FROM CUSTOMER LIMIT 10)

9-Mar-2014, 07:37 PM
Yeh, we could do that, but SQL queries can be input from our customers so we like to be able to limit it in code. Right now we insert TOP xxx in the SQL query to control it. Does LIMIT work?

9-Mar-2014, 07:47 PM
Does LIMIT work?

The LIMIT clause is supported in DB2, Oracle and MySQL. The equivalent clause in MSSQL, as you already know, is TOP

See: http://www.w3schools.com/sql/sql_top.asp