gtpc2me1 | C/C++ Language Support User's Guide |
This function returns a temporary sequence collection containing the primary key values for all elements in the collection.
Format
#include <c$to2.h> long TO2_getCollectionKeys(TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr, TO2_PID_PTR retnPid_ptr);
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.
The following error codes are common for this function:
TO2_ERROR_ENV
TO2_ERROR_METHOD
TO2_ERROR_PID
Programming Considerations
Examples
The following example creates a temporary sequence collection containing the keys of all the elements in the source collection.
#include <c$to2.h> /* needed for TPFCS API functions */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_PID keyedCol; /* PID of source collection */ TO2_ENV_PTR env_ptr; /* pointer to the TPFCS environment */ TO2_PID keys; /* PID of sequence collection of keys */
·
·
·
if (TO2_getCollectionKeys(&keyedCol, env_ptr, &keys) == TO2_ERROR) { printf("TO2_getCollectionKeys failed!\n"); process_error(env_ptr); return; } else { printf("TO2_getCollectionKeys successful!\n"); }
·
·
·
TO2_deleteCollection(&keys, env_ptr);
Related Information