#coding=utf-8 import threading import time import cx_Oracle from pprint import pprint import csv table_name = "dbtest.csv" f = open(table_name + ".csv", "w")
def exp01(): conn = cx_Oracle.connect('tlcbuser/xxxxxxxxx@2.2.2.2/tlyy') cursor = conn.cursor() owner = "system" writer = csv.writer(f, lineterminator="\n", quoting=csv.QUOTE_NONNUMERIC) tname = threading.current_thread() print tname exportOracleSql = "select 'exp01' from dual" print exportOracleSql x = cursor.execute(exportOracleSql) time.sleep(11) cursor.close() conn.close()
def exp02(): conn = cx_Oracle.connect('tlcbuser/xxxxxxxxx@2.2.2.2/tlyy') cursor = conn.cursor() owner = "system"
|