Created
July 25, 2014 21:43
-
-
Save timfreund/2323960da89a18c98308 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import cx_Oracle | |
username = "user" | |
password = "pass" | |
database = "tnsname" | |
con = cx_Oracle.connect(username, password, database) | |
cur = con.cursor() | |
results = cur.execute("select file_id, encrypted_data from bank_file where disbursement_file_id in (1, 2, 3)") | |
for row in results: | |
disb_file = open("%s_%d" % (database, row[0]), "w") | |
disb_file.write(row[1]) | |
disb_file.close() | |
cur.close() | |
con.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment