gtpc2mgm | C/C++ Language Support User's Guide |
This function changes data store (DS) attributes using a passed option list.
Format
#include <c$to2.h> long TO2_changeDS ( TO2_ENV_PTR env_ptr, const char dsname, const TO2_OPTION_PTR optionListPtr);
Normal Return
The normal return is a positive value.
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.
Programming Considerations
A commit scope will be created for the TO2_changeDS request. If the request is successful, the scope will be committed. If an error occurs while processing the TO2_changeDS request, the scope will be rolled back.
Examples
The following example creates an inventory collection if one does not exist. This example also changes a specified data store to use immediate deletes.
#include <c$to2.h> /* Needed for TO2 API functions */ #include <stdio.h> /* APIs for standard I/O functions */ long err_code; TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ char dsname[]="TESTDS1 "; /* data store to change */ TO2_OPTION_PTR optionListPtr; /* invoke TO2 to create option list */
·
·
·
optionListPtr=TO2_createOptionList(env_ptr, TO2_OPTION_LIST_DS, /* create options */ TO2_DS_INVENTORY, /* create a PID */ /* inventory collection */ TO2_DS_DELETE_IMMED, /* process collection */ /* deletions immediately*/ TO2_OPTION_LIST_END); /* end of options */ if (optionListPtr == TO2_ERROR) process_error(env_ptr); if (TO2_changeDS(env_ptr, dsname, optionListPtr) == TO2_ERROR) { printf("TO2_changeDS failed!\n"); process_error(env_ptr); } else { printf("TO2_changeDS successful!\n"); }
Related Information