Skip to content

Instantly share code, notes, and snippets.

@arofiqimaulana
Last active August 14, 2024 03:58
Show Gist options
  • Select an option

  • Save arofiqimaulana/dbf2ff55c4832591a611c6ea879488ba to your computer and use it in GitHub Desktop.

Select an option

Save arofiqimaulana/dbf2ff55c4832591a611c6ea879488ba to your computer and use it in GitHub Desktop.
Update Command SQL
def updateData(df):
data = df.loc[:,['profesi_master','updated_at','userid']].values.tolist()
sql_update ="""
UPDATE tblcustomfieldsvalues
SET value = %s, updated_at = %s
WHERE relid = %s
"""
mycursor1 = connWarehouse.cursor()
mycursor1.executemany(sql_update,data)
connWarehouse.commit()
mycursor1.close()
connWarehouse.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment