This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |
| a_f:a:exec_sp [2025/11/01 07:36] – [Syntax] aware_admin | a_f:a:exec_sp [2025/11/03 05:34] (current) – [Pagination in Queries implemented as stored procedures] aware_admin |
|---|
| * ''ObjectName'' if the stored procedure returns a result set (the result of the ''SQL SELECT'' statement) AwareIM can convert each record to the instance of the specified object. An object that is persisted in the database table of the ''SELECT'' statement must be defined. The resulting object instances are either placed in the Context if the ''EXEC_SP'' action is used in rules or returned by a query if the action is used in a rule form of the query | * ''ObjectName'' if the stored procedure returns a result set (the result of the ''SQL SELECT'' statement) AwareIM can convert each record to the instance of the specified object. An object that is persisted in the database table of the ''SELECT'' statement must be defined. The resulting object instances are either placed in the Context if the ''EXEC_SP'' action is used in rules or returned by a query if the action is used in a rule form of the query |
| |
| ===== Pagination in Queries implemented as stored procedures ===== | |
| |
| In order to support pagination in queries implemented as stored procedures you need to define two parameters for your stored procedure with special names - ''LIMIT_START_PARAM'' and ''LIMIT_SPAN_PARAM''. | |
| The former defines the start of the range to be shown by the query and the latter - how many records to return. A stored procedure can then use the values of these parameters to limit returned records. For example. in MySQL you can use the ''LIMIT'' keyword. Note that AwareIM will ignore any values for these parameters that you specify when defining a query (but you still need to provide some values to conform with the syntax of the query). For example: | |
| |
| |
| ''EXEC_SP 'Some name' WITH @LIMIT_SPAN_PARAM=0, @LIMIT_START_PARAM=0 RETURN SomeObject'' | |
| |
| At runtime values of zeroes for these parameters will be replaced with proper values that pagination requires. | |
| ===== Examples ===== | ===== Examples ===== |
| |