%SelectByRowNum meta-SQL element
Syntax
%SelectByRowNum(:num1 [prefix] [[wherestring] [orderbystring]], :num_x, :num_x+1)
Description
%SelectByRowNum is shorthand for selecting the fields in the specified record by the specified row's number scope, wrapping datetime fields with %DateOut, %TimeOut, and so on.
The pseudocode looks like this:
Select (AllFields, :num1 correlation_id) from (Select ROW_NUMBER() OVER( orderbystring) AS ROW_NUM, (AllFields, :num1 correlation_id) FROM %Table(:num1) wherestring) Where ROW_NUM >= :num_x AND ROW_NUM <= :num_x+1
Example
Local SQL &SQL_OBJ;
&SQL_OBJ = CreateSQL("%SelectByRowNum(:1 FILL where FILL.CLASSID = :2 order by FILL.CLASSID, :3, :4)", Record.PSAUTHOPTN, "PTMSF_CLIENT_USER", 1, 5);
&SQL_OBJ.Close();