|
|
Executing a Command
The simplest way to execute a statement is to execute it directly using the SQLExecDirect function.
Each INSERT, UPDATE, and DELETE statement returns the number of rows affected by the operation, the function SQLRowCount returns 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 );
|
Upright Database Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 dbtechnology@upright.se |
|
|