Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

support copyfrom #63

Open
Open
@borissmidt

Description

@borissmidt

To insert mutliple values at once there is the sqlccopyfrom, but it it is unsupported in sqlc-gen-python

But it should be quite easy to implement using anexecutemany statement:
https://stackoverflow.com/questions/13020908/sql-multiple-inserts-with-python

rows= []forrowinrange(sheet.nrows):"""name is in the 0th col. email is the 4th col."""name=sheet.cell(row,0).valueemail=sheet.cell(row,4).valuerows.append((name,email))db=MySQLdb.connect(host=host,user=user,db=dbname,passwd=pwd)cursor=db.cursor()cursor.executemany("""INSERT INTO mailing_list (name,email) VALUES (%s,%s)""",rows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp