def select_sql_execute(args): s_db_flag = args[0] d_db_flag = args[2] s_sql = args[1] d_sql = args[3] print("from ",s_db_flag,"to ",d_db_flag) print("select sql:",s_sql) print("insert sql:",d_sql) # so = ctypes.CDLL("./getlobflag.so") # LOB_FLAG = chr(so.getlobflag()) ins_db_obj = create_db_obj(s_db_flag,LOB_FLAG) print(ins_db_obj) ins_sql = Db_sql(s_sql) l_values = ins_db_obj.get_result(ins_sql) if l_values: l_insert_conf = [d_db_flag,d_sql] l_insert = list(map(lambda l:l_insert_conf+l,l_slice(l_values))) with Pool(len(l_insert)) as p: p.map(insert_sql_execute,l_insert) return 0
def insert_sql_execute(args): d_db_flag = args[0] ins_db_obj = create_db_obj(d_db_flag,'N') ins_sql = Db_sql(args[1],args[2:]) # sql_execute = ins_db_obj.wrap_sql_execute_values(ins_sql) # list(map(sql_execute,ins_sql.value)) ins_db_obj.get_result_many(ins_sql) return 0