本文整理汇总了Python中connector.Connector.apply_proc_multi方法的典型用法代码示例。如果您正苦于以下问题:Python Connector.apply_proc_multi方法的具体用法?Python Connector.apply_proc_multi怎么用?Python Connector.apply_proc_multi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connector.Connector
的用法示例。
在下文中一共展示了Connector.apply_proc_multi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fill_gen_assign_workshop_attendee
# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import apply_proc_multi [as 别名]
def fill_gen_assign_workshop_attendee():
connector = Connector()
conn = connector.connect(secretpassword)
cursor = conn.cursor()
workshop_attendees = []
cursor.execute("select distinct Attendees.AttendeeID, WorkshopReservations.WReservationID "
"from Attendees "
"inner join Participation on Participation.AttendeeID = Attendees.AttendeeID "
"inner join Reservations on Reservations.ReservationID = Participation.ReservationID "
"inner join WorkshopReservations on WorkshopReservations.ReservationID = Reservations.ReservationID")
row = cursor.fetchone()
while row:
workshop_attendees.append((row[0], row[1]))
row = cursor.fetchone()
filler = Connector()
workshop_attendees_size = len(workshop_attendees)
filler.apply_proc_multi('AssignParticipantToWorkshop', workshop_attendees, workshop_attendees_size)
conn.close()
示例2: fill_gen_assign_attendee
# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import apply_proc_multi [as 别名]
def fill_gen_assign_attendee():
connector = Connector()
conn = connector.connect(secretpassword)
cursor = conn.cursor()
individual_participation = []
cursor.execute("select distinct Attendees.AttendeeID, Reservations.ReservationID "
"from Attendees "
"inner join Clients on Attendees.ClientID = Clients.ClientID "
"inner join Reservations on Reservations.ClientID = Clients.ClientID "
"inner join Individual on Individual.ClientID = Clients.ClientID")
row = cursor.fetchone()
while row:
individual_participation.append((row[0], row[1]))
row = cursor.fetchone()
company_participation = []
cursor.execute("select distinct Attendees.AttendeeID, Reservations.ReservationID "
"from Attendees "
"inner join Clients on Attendees.ClientID = Clients.ClientID "
"inner join Reservations on Reservations.ClientID = Clients.ClientID "
"inner join Company on Company.ClientID = Clients.ClientID")
row = cursor.fetchone()
while row:
company_participation.append((row[0], row[1]))
row = cursor.fetchone()
# Two list of (AttendeeID, ReservationID) to apply
# The following lines may cause declination of IDE control xD
# print(individual_participation)
# print(len(individual_participation))
# print(company_participation)
# print(len(company_participation))
# Those insertions causes error -> try block
filler = Connector()
individual_size = len(individual_participation)
filler.apply_proc_multi('AssignAttendee', individual_participation, individual_size)
company_size = len(company_participation)
filler.apply_proc_multi('AssignAttendee', company_participation, company_size)
conn.close()