Get a list of columns that uniquely identifies a row
char *Ns_DbBestRowId ( Ns_DString *pds, Ns_DbHandle *handle, char *table );
The Ns_DbBestRowId function returns a list of the column names that uniquely identify a row in the specified table. Upon completion, the returned pointer points to a list of column names in the following format:
"column1\0column2\0column3\0\0"
char *columnNameList;
Ns_DbHandle *handle;Ns_DString ds;if ((handle = Ns_DbPoolGetHandle("aPoolName")) != NULL) {
Ns_DStringInit(&ds); columnNameList = Ns_DbBestRowId(&ds, handle, "aTable"); while (*columnNameList != '\0') { printf("%s\n", columnNameList); columnNameList += strlen(columnNameList) + 1; } Ns_DStringFree(&ds); }