Skip navigation links

MySQL Forums :: Connector/Python :: Is the mysql_connect.commit() always require with Insert, Update and Delete records?


Advanced Search

Is the mysql_connect.commit() always require with Insert, Update and Delete records?
Posted by: Ernest Bonat ()
Date: March 12, 2014 10:41AM

I’m trying to insert a new record into the magazine_type table following the code below:

sql = ('INSERT INTO magazine_type (type, description, notes, update_id) VALUES (%s, %s, %s, %s)')
paremeters = ('Lunix', 'The Lunix Magazine', 'The Notes', 300)
cursor = mysql_connect.cursor()
cursor.execute(sql, parameters)

The record will not be inserted until the commit() method of the connection object is done as:

mysql_connect.commit()

Is the mysql_connect.commit() always required with Insert, Update and Delete records?

Options: ReplyQuote


Subject Written By Posted
Is the mysql_connect.commit() always require with Insert, Update and Delete records? Ernest Bonat 03/12/2014 10:41AM
Re: Is the mysql_connect.commit() always require with Insert, Update and Delete records? Ernest Bonat 03/13/2014 10:14AM
Re: Is the mysql_connect.commit() always require with Insert, Update and Delete records? Geert Vanderkelen 03/17/2014 12:21AM
Re: Is the mysql_connect.commit() always require with Insert, Update and Delete records? Ernest Bonat 03/17/2014 12:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.