Get a list of tables in database
char *Ns_DbTableList ( Ns_DString *pds, Ns_DbHandle *handle, int includesystem );
The Ns_DbTableList function returns a list of tables in the database referred to by handle
. The includesystem
argument indicates whether to include system tables in this list. Upon completion, the returned pointer points to a list of tables in the following format:
"table1\0table2\0table3\0\0"
char *tables; Ns_DbHandle *handle; Ns_DString ds; Ns_DStringInit(&ds); if ((handle = Ns_DbPoolGetHandle("aPoolName")) != NULL) { tables = Ns_DbTableList(&ds, handle, 1); while (*tables != '\0') { printf("%s\n", tables); tables += strlen(tables) + 1; } Ns_DStringFree(&ds); }