SAP Replication Server introduces a new function string
rs_select_count_star to get the number of rows from a primary table.
rs_select_count_star is used by the select thread in subscriptions
created with the direct_load option.
You can customize the
rs_select_count_star function string. The default
function string for rs_select_count_star is:
select count(*) from <primary table> [<where_clause>]
rs_select_count_star
Use rs_select_count_star to get the number of rows from a primary
table.
Example
Suppose a subscription is created with where
<au_lname> > 1010. In this
example, the function string
rs_select_count_star is changed so
that it returns number of rows for table authors where
<au_lname> >
1000.
create function string authors.rs_select_count_star;select_count_1 for flat_file_class _function_class with overwrite scan 'select count(*) from authors where au_lname > ?au_lname!user?' output language 'pdb_execute_sql "select count(*) from authors where au_lname >?au_lname!user? - 10"'
Usage
rs_select_count_star should be consistent with
rs_select. For example, if you alter the function string for
rs_select to select from another table, either:
- Change the function string for rs_select_count_star if
the two tables do not have the same number of rows.
- Do not change the function string for
rs_select_count_star if the two tables have the same
number of rows.