gtpc2mhw | C/C++ Language Support User's Guide |
This function reconstructs either the data chains or the internal mapping of a collection that has errors. A reconstruction report that contains a list of the actions taken on the collection along with any errors that cannot be resolved is returned. The errors that cannot be resolved must be corrected manually by the database administrator (DBA).
Format
#include <c$to2.h> long TO2_reconstructCollection ( TO2_PID_PTR collectPtr, TO2_ENV_PTR env_ptr, const TO2_OPTION_PTR optionListPtr, TO2_PID_PTR reconReportPtr, enum TO2_RECON_METHOD reconMethod);
Normal Return
The normal return is a positive value, which indicates that processing was completed normally; it does not necessarily mean that the collection is free of errors.
Error Return
An error return is indicated by a zero. When zero is returned, use the TO2_getErrorCode function to determine the specific error code. For more information, see Error Handling.
The following error codes are common for this function:
TO2_ERROR_ENV
TO2_ERROR_METHOD
Programming Considerations
Examples
The following example reconstructs the data chain of a collection. The example assumes that the data chain of the collection is corrupted, but the internal mapping is still intact.
#include <c$to2.h> /* Needed for TO2 API Functions */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_ENV_PTR env_ptr; TO2_PID collect; TO2_PID reconReport;
·
·
·
/*******************************************************************/ /* Reconstruct the collection's data chain using the internal */ /* directory structure. */ /*******************************************************************/ if (TO2_reconstructCollection(&collect, env_ptr, NULL, &reconReport, TO2_RECON_DATA) == TO2_ERROR) { printf("TO2_reconstructCollection failed!\n"); process_error(env_ptr); } else printf("TO2_reconstructCollection successful!\n");
Related Information