Ns_DbDML
Overview
Execute an SQL DML statement
Syntax
int Ns_DbDML(
Ns_DbHandle *handle,
char *sql
);
Description
The Ns_DbDML function executes SQL that should be a data manipulation language statement such as an insert or update, or data definition language such as a create table. If the statement was executed successfully, Ns_DbDML returns NS_OK. If the statement results in rows being returned or a other database error, Ns_DbDML returns NS_ERROR. 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.
Example
Ns_DbHandle *handle;
int status;
if ((handle = Ns_DbPoolGetHandle("aPoolName")) != NULL) {
status = Ns_DbDML(handle,
"insert into aTable (colName1,colName2) values (1,2)");
if (status != NS_OK) {
/* handle error condition */
}
}