Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


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 );

Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX