Show TOC

rs_get_thread_seqLocate this document in the navigation structure

Returns the sequence number for the specified entry in the <rs_threads> system table.

Syntax
rs_get_thread_seq @<rs_id>
Parameters
rs_id

A number of <int>< >datatype. It represents the ID of the entry to be checked and matches the value of the <id> column in the <rs_threads> system table.

Examples
Example 1

Creates an rs_get_thread_seq function string that executes a select statement in the <rs_threads> table.

create function string rs_get_thread_seq
 for sqlserver_derived_class
 output language
 'select seq from rs_threads
   where id = ?rs_id!param?'
Usage
  • Replication Server executes rs_get_thread_seq to check the completion status of preceding transactions. It is executed only when more than one DSI thread is defined for a connection. The function returns a single row with a single column, <seq>, which contains the sequence number for the specified ID.

  • The thread invoking this function is blocked until the transaction that last modified the specified entry completes its transaction.

  • rs_get_thread_seq has function-string-class scope.

  • Replication Server creates an initial rs_get_thread_seq function string for the system-provided function-string classes during installation.

  • If you use a user-created base function-string class and you use the parallel DSI feature, you must create a function string for the rs_get_thread_seq function. If you do not use parallel DSI, you do not need to create a function string for this function.

  • Create or customize an rs_get_thread_seq function string at the Replication Server that is the primary site for the class.