Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site

http://developer.mimer.com


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.

For example:

 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
Mimer SQL Documentation TOC PREV NEXT INDEX