A structure containing the results of the most recent synchronization, so that appropriate action can be taken in the application program.
ul_bool ULGetSynchResult( ul_synch_result * synch-result );
synch-result A structure to hold the synchronization result. This structure is defined in ulglobal.h as follows:
typedef struct ul_synch_result { an_sql_code sql_code; char sql_error_string[]; ul_stream_error stream_error; ul_bool upload_ok; ul_bool ignored_rows; ul_auth_status auth_status; ul_s_long auth_value; SQLDATETIME timestamp; ul_bool partial_download_retained; ul_synch_status status; } ul_synch_result, * p_ul_synch_result;
The individual parameters include:
sql_code The SQL code from the last synchronization. For a list of SQL codes, see SQL Anywhere error messages sorted by SQLSTATE.
sql_error_string The error message text associated with the error reported in the field sql_code.
stream_error A structure of type ul_stream_error. See Stream Error synchronization parameter.
upload_ok True if the upload was successful; false otherwise.
ignored_rows True if uploaded rows were ignored; false otherwise.
auth_status The synchronization authentication status. See Authentication Status synchronization parameter.
auth_value The value used by the MobiLink server to determine the auth_status result. See Authentication Value synchronization parameter.
timestamp The time and date of the last synchronization.
partial_download_retained Flag to indicate whether a partial download has been retained.
status The status information used by the observer function. See Observer synchronization parameter.
The application must allocate a ul_synch_result object before passing it to ULGetSynchResult. The function fills the ul_synch_result with the result of the last synchronization. These results are stored persistently in the database.
The function is of particular use when synchronizing applications on the Palm OS using HotSync, as the synchronization takes place outside the application itself. The SQLCODE value set in the connection reflects the result of the connecting operation itself. The synchronization status and results are written to the HotSync log only. To obtain extended synchronization result information, call ULGetSynchResult when connected to the database.
The following code checks for success of the previous synchronization.
ul_synch_result synch_result; memset( &synch_result, 0, sizeof( ul_synch_result ) ); db_init( &sqlca ); EXEC SQL CONNECT "dba" IDENTIFIED BY "sql"; if( !ULGetSynchResult( &sqlca, &synch_result ) ) { prMsg( "ULGetSynchResult failed" ); } |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |