aboutsummaryrefslogtreecommitdiff
path: root/scripts/maintenance/Update_Case_Attributes_MySQL_tab.py
blob: 0f8602c9d7b9d21383d976f2c7f86089fadfc538 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python2
########################################################################
# Last Updated Apr 11, 2016 By Arthur and Zach
########################################################################
import string
import sys
import MySQLdb
import getpass
import time
import csv
########################################################################

mydb = MySQLdb.connect(host='localhost',
    user='username',
    passwd='',
    db='db_webqtl')
cursor = mydb.cursor()

csv_data = csv.reader(file('GN711_pvalues.txt'), delimiter ="\t")
for row in csv_data:

    cursor.execute("""UPDATE ProbeSetXRef SET pValue = %s WHERE ProbeSetFreezeId = %s AND ProbeSetId = %s """,
          (row))
#close the connection to the database.
mydb.commit()
cursor.close()
print "Done"