Ns_Set *Ns_Db1Row( Ns_DbHandle *handle, char *sql );
If the SQL statement returns zero rows or a database error has occurred, Ns_Db1Row returns NULL. Detailed error messages may have accumulated in an internal buffer in the Ns_DbHandle. These errors can be conveyed back to the user through the Ns_DbReturnError function.
Ns_Set *row; Ns_DbHandle *handle; if ((handle = Ns_DbPoolGetHandle("aPoolName")) != NULL) { row = Ns_Db1Row(handle, "select aName from aTable"); if (row != NULL) { char *value; value = Ns_SetGet(row, "aName"); /* use `value' here */ Ns_SetFree(row); } }