I want to get a list of all products in the database using C/C API DTK. Is it possible ?
Cybersecurity
DevOps Cloud
IT Operations Cloud
If an answer to your question is correct, click on "Verify Answer" under the "More" button. The answer will now appear with a checkmark. Please be sure to always mark answers that resolve your issue as verified. Your fellow Community members will appreciate it!  Learn more
Hello,
You can use PcmsQuery for the object type PCMS_PRODUCT to obtain UIDs of all products. Then get details per each UID via PcmsInitUid. For instance:
// "conId" is obtained via connecting somewhere above PcmsObjStruct obj = { 0 }; obj.objType = PCMS_PRODUCT; int noUids = 0; int *uids = NULL; if (PcmsQuery(conId, &obj, 0, &noUids, &uids) == PCMS_OK && noUids) { for (int i = 0; i < noUids) { if (PcmsInitUid(conId, *uids, PCMS_PRODUCT, &obj) != PCMS_OK) continue; // use "obj" to get details of Product } }--
Regards,
Alex
--
Alex Shevchenko
Sr Development Manager
Although I work for OpenText, I am speaking for myself and not for OpenText.
If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button.
Hello,
You can use PcmsQuery for the object type PCMS_PRODUCT to obtain UIDs of all products. Then get details per each UID via PcmsInitUid. For instance:
// "conId" is obtained via connecting somewhere above PcmsObjStruct obj = { 0 }; obj.objType = PCMS_PRODUCT; int noUids = 0; int *uids = NULL; if (PcmsQuery(conId, &obj, 0, &noUids, &uids) == PCMS_OK && noUids) { for (int i = 0; i < noUids) { if (PcmsInitUid(conId, *uids, PCMS_PRODUCT, &obj) != PCMS_OK) continue; // use "obj" to get details of Product } }--
Regards,
Alex
--
Alex Shevchenko
Sr Development Manager
Although I work for OpenText, I am speaking for myself and not for OpenText.
If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button.