savepoint in sql
• SAVEPOINT name —> marks a save point • COMMIT —> making all pending changes permanent; • ROLLBACK —> discharges all pending changes to prev commit • ROLLBACK TO name —> rolls back changes to savepoint
Here is what the above code is Doing:
1. Create a connection to the database.
2. Create a cursor object.
3. Execute the CREATE TABLE statement.
4. Execute the INSERT statement.
5. Commit the changes to the database.
6. Close the database connection.