|
|
Executing a Command
The simplest way to execute a statement is to execute it directly using the
SQLExecDirectfunction.Each
INSERT,UPDATE, andDELETEstatement returns the number of rows affected by the operation, the functionSQLRowCountreturns this count.SQLINTEGER rowcount; . . . /* Allocate statement handle */ SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ); SQLExecDirect( hstmt, "UPDATE mimer_store.currencies \ SET exchange_rate = exchange_rate * 1.05 \ WHERE code = 'USD'", SQL_NTS ); SQLRowCount( hstmt, &rowcount ); printf( "%d rows have been updated\n", rowcount );
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|