Data Replication 2
Results 1 to 1 of 1

Thread: INFO: SQLExecute behavior when performing an update operation

  1. #1
    Costi Zaboura is offline World Wide Support Manager
    Join Date
    Aug 2006
    Posts
    300
    Rep Power
    14

    INFO: SQLExecute behavior when performing an update operation

    Description
    In some cases even if the UPDATE operation was not performed, the SQLExecute may not return any errors.


    Solution
    Here are few rules that the user should keep in mind:

    If an update statement with a where clause did not update any row, for example when the where clause did not apply to any existing record, then SQLExecute will succeed, but SQLRowCount() will return “o rows affected”.
    If an update fails because an error occurred during the update operation, for example; constant violation or wrong data being sent, then the SQLExecute should return an error. Of course a call to SQLRowCount will also return “0 rows affected”.
    In the case of a failure in SQLExecute for an update statement, some of the states are specific to the error, for instance; for a validation of a unique index constraints, there is a specific state (SQLSTATE 23000). Sending invalid data using parameters also has specific state codes.

    For more information, review the Microsoft ODBC API documentation:

    SQLExecute Function
    SQLRowCount Function
    Last edited by Admin_attu; 08-30-2006 at 12:01 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •