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
page

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

Testcases:
No testcase defined.
Source code:
ns_log Notice "Deprecated proc pa_pagination_paginate_query used:\n[ad_get_tcl_call_stack]"


    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: