>In SQL-Server you can set @@ROWCOUNT to 5 to retrieve just 5 record once. I don't use Oracle, but guess something similar should be there.
A better way to do this in MS SQL Server would be:
r = SQLEXEC(c, [SET ROWCOUNT 5; SELECT * FROM table ORDER BY sal DESC; SET ROWCOUNT 0])
-Mike