To limit the size of
a result set, you can use either SAS syntax or standard JDBC syntax.
Because there are implementation differences between the two types
of syntax, you should use the syntax that best suits your needs.
The sample code in the
table can be used to produce a result set that contains a maximum
of 20 rows.
Two Ways to Limit a Result Set
|
|
|
|
stmt.executeUpdate("reset outobs=20")
|
-
Limits the number of rows that
the server sends back.
-
The limit remains for the duration
of the connection, as long as the limit is not changed with subsequent
code.
|
|
|
-
Limits the number of rows that
the client asks for.
-
The limit remains for the duration
of the statement, as long as the limit is not changed with subsequent
code.
|
1Simple queries of the form
SELECT * FROM TABLE are not affected by the OUTOBS= option. You must
explicitly select the columns or provide a WHERE clause.
|
Note: In addition, standard JDBC
syntax is more portable than SAS syntax.