sqlrollback() — Rollback Any Pending Transaction

Rolls back any pending database transaction. This function supports the EXEC SQL ROLLBACK WORK statement to cancel and roll back any database transaction that is active since the most recent:

This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter:

SYNTAX
int
sqlrollback () 

EXAMPLE

This example implements typical error processing code, displaying the latest SQL error messages (from sqlgetmsg()) and rolling back the incomplete transaction:

  err:
    printf("Error occurred.\n");
    while ((msg = (char *) sqlgetmsg()) != (char *) 0)
        printf("%s\n",msg);
    printf("\nRolling back all work...\n");
    /* EXEC SQL ROLLBACK WORK; */
    sqlrollback();
            .
            .
            . 

SEE ALSO

sqlcommit() — Commit the Database Transaction for committing transactions.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095