begin_poll property

This is a SQL statement that is executed before each Notifier poll. Typical uses are to detect data change in the database and create push requests that are later fetched with the request_cursor.

The statement is executed in a standalone transaction.

This property is optional. The default is null.

See also
Example

This example creates a push request for a Notifier called Notifier A. It uses a SQL statement that inserts rows into a table called PushRequest. Each row in this table represents a message to send to an address. The WHERE clause determines what push requests are inserted into the PushRequest table.

To use the stored procedure ml_add_property with a SQL Anywhere consolidated database, run the following command:

ml_add_property( 'SIS',
  'Notifier(Notifier A)',
  'begin_connection',
  'INSERT INTO PushRequest
     ( gateway, mluser, subject, content )
        SELECT ''MyGateway'', DISTINCT mluser,
         ''sync'', stream_param
        FROM MLUserExtra, mluser_union, Dealer
        WHERE
        MLUserExtra.mluser = mluser_union.name
        AND( push_sync_status = ''waiting for request''
         OR datediff( hour, last_status_change, now() ) > 12 )
        AND ( mluser_union.publication_name is NULL
         OR mluser_union.publication_name =''FullSync'' ) 
        AND
         Dealer.last_modified > mluser_union.last_sync_time'
);