当前位置: 首页>>代码示例>>Python>>正文


Python Connector.apply_proc_multi方法代码示例

本文整理汇总了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()
开发者ID:onegrx,项目名称:db-gen,代码行数:30,代码来源:generator.py

示例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()
开发者ID:onegrx,项目名称:db-gen,代码行数:54,代码来源:generator.py


注:本文中的connector.Connector.apply_proc_multi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。