KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Modifying the number of rows returned by a query
PRODUCT: 4D | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: August 7, 2006

You can set the maximum number of rows in the resulting group of a query by using the ODBC SET OPTION command. You pass the ODBC MAX ROWS constant and the max number of rows desired as parameters. Below is a sample code that shows how to limit the max rows to 100:

ODBC LOGIN("TestODBC20044";"";"")
SQLStmt:="SELECT * FROM Employee"
ODBC SET OPTION(ODBC Max Rows ;100)
ODBC EXECUTE(SQLStmt;[Result1]Field1;[Result1]Field2)
ODBC LOAD RECORD(ODBC All Records )