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 Information Technology AB
Phone: +46 18 780 92 00
Mimer SQL Documentation TOC PREV NEXT INDEX