pa_pagination_paginate_query (public, deprecated)

 pa_pagination_paginate_query sql page

Defined in packages/photo-album/tcl/photo-album-procs.tcl

Deprecated. Invoking this procedure generates a warning.

takes a query and returns a query that accounts for pagination

Parameters:
sql (required)
page (required)

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) parameter::get parameter::get (public) pa_pagination_paginate_query pa_pagination_paginate_query pa_pagination_paginate_query->ad_log_deprecated pa_pagination_paginate_query->parameter::get

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc pa_pagination_paginate_query

    set rows_per_page [parameter::get -parameter ThumbnailsPerPage]
    set start_row [expr {$rows_per_page*($page-1) + 1}]

    set query "
      select *
      from
        (
          select 
            x.*, rownum as row_id
      from
        ($sql) x
        ) ordered_sql_query_with_row_id
      where
        row_id between $start_row and $start_row + $rows_per_page - 1"
    
    return $query
Generic XQL file:
packages/photo-album/tcl/photo-album-procs.xql

PostgreSQL XQL file:
packages/photo-album/tcl/photo-album-procs-postgresql.xql

Oracle XQL file:
packages/photo-album/tcl/photo-album-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: