Returns information about the last synchronization initiated by the SYNCHRONIZE statement.
sp_get_last_synchronize_result ( conn_id, complete_only )
conn_id Use this INTEGER parameter to specify the connection ID number for a connection on which the SYNCHRONIZE statement was executed. If no value is specified, then the connection ID of the current connection is used.
complete_only Set this BIT parameter to 1 to have the stored procedure return information about completed synchronizations. Set the parameter to 0 to return information about synchronizations that are currently active.
Column name | Data type | Description |
---|---|---|
row_id | BIGINT | The primary key of the table used to determine the order in which rows were inserted into the table. |
conn_id | UNSIGNED INT | The connection id number of the connection that executed the SYNCHRONIZE statement that generated this event. |
result_time | TIMESTAMP | The time the event was added to the synchronize_results table. |
result_type | CHAR(128) | The type of event. |
parm_id | INTEGER | Each event can have zero or more parameters associated with it. The parm_id column orders the parameters associated with each event. |
parm_result | long varchar | The message text associated with the event parameter. |
To view details of past or current synchronizations, you can use the sp_get_last_synchronize_result stored procedure as an alternative to directly querying the synchronize_results and synchronize_parameters global shared temporary table. The stored procedure only returns the results of the last synchronization for the specified connection ID number. If you do not specify any parameters, the last completed synchronization on the current connection is returned.
You can also use this stored procedure to monitor the progress of a synchronization on a connection that is different from your current connection. To monitor the progress of a synchronization on a different connection:
Execute a SELECT CONNECTION_PROPERTY statement to determine the connection ID of your current connection.
Execute a SYNCHRONIZE statement using the connection ID returned by the SELECT CONNECTION_PROPERTY statement.
On a different connection, execute a SELECT CONNECTION_PROPERTY statement and set the complete_only parameter to 0. Information about the last synchronization for the specified connection is returned, even if the synchronization is incomplete.
Following is a list of events and their associated parm_id values from the synchronize_parameters table:
Event | parm_id value | Description |
---|---|---|
DBSC_EVENTTYPE_ERROR_MSG | 0 | The text of the error message. |
1 | The message id associated with the message. | |
DBSC_EVENTTYPE_WARNING_MSG | 0 | The text of the warning message. |
1 | The message id associated with the message. | |
DBSC_EVENTTYPE_INFO_MSG | 0 | The text of the information message. |
1 | The message id associated with the message. | |
DBSC_EVENTTYPE_PROGRESS_INDEX | 0 | The new progress index value. |
DBSC_EVENTTYPE_PROGRESS_TEXT | 0 | The new progress text. |
DBSC_EVENTTYPE_TITLE | 0 | The new window title. |
DBSC_EVENTTYPE_SYNC_DONE | 0 | The exit code from the synchronization. 0 indicates success. |
DBSC_EVENTTYPE_ML_CONNECT | 0 | The communications protocol being used. |
1 | The network protocol options being used. | |
DBSC_EVENTTYPE_DOWNLOAD_COMMITTED | 0 | The number of insert/update operations committed. |
1 | The number of delete operations committed. | |
DBSC_EVENTTYPE_UPLOAD_SENT | 0 | The number of insert operations uploaded. |
1 | The number of update operations uploaded. | |
2 | The number of delete operations uploaded. |
DBA
None
The following example returns information about the last synchronization that completed on the current connection.
CALL sp_get_last_synchronize_result(); |
The following example uses named parameters when calling the sp_get_last_synchronize_result system procedure, and returns information about the last completed synchronization that was initiated from connection ID 25.
CALL sp_get_last_synchronize_result( @conn_id=25, @complete_only=1); |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |