Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8050237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:00:56+00:00 2026-06-05T07:00:56+00:00

I am working with over 29 million elements, so thought a database would make

  • 0

I am working with over 29 million elements, so thought a database would make more sense than an array.

Previously I was passing elements one at a time to the execute function, but I believe passing an array of 100,000 elements at a time to the executemany function would be more efficient.

I have shortened my 180 odd line code into this short test-case:

import sqlite3

if __name__ == '__main__':
    connection = sqlite3.connect('array.db')
    cursor = connection.cursor()
    cursor.execute("create table array (word text);")
    cursor.executemany("insert into array values (?)", [u'usa', u'sharp', u'rise', u'seen', u'in', u'cd', u'bootlegs', u'sharp', u'rise', u'seen', u'in', u'cd', u'bootlegs', u'los', u'angeles'])
    connection.commit()
    cursor.execute("select * from array;")
    print cursor.fetchall()

Output:

Traceback (most recent call last):
        cursor.executemany("insert into array values (?)", [u'usa', u'sharp', u'rise', u'seen', u'in', u'cd', u'bootlegs', u'sharp', u'rise', u'seen', u'in', u'cd', u'bootlegs', u'los', u'angeles'])
    sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 3 supplied.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:00:57+00:00Added an answer on June 5, 2026 at 7:00 am

    Ahh, they need to be in their own elements:

    import sqlite3
    
    if __name__ == '__main__':
        connection = sqlite3.connect('array.db')
        cursor = connection.cursor()
        cursor.execute("create table array (word text);")
        cursor.executemany("insert into array values (?)", [[u'nabisco'],[u'usa'], [u'sharp'], [u'rise']])
        connection.commit()
        cursor.execute("select * from array;")
        print cursor.fetchall()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on porting over a database from a custom MSSQL CMS to
I am working over one my student project over .Net4 and MVC3. Project is
I need to get the free Google charts working over SSL without any security
Are there any geo-location api services like hostip.info that working over https Free services
I am working through the SDL tutorials over at http://lazyfoo.net/SDL_tutorials/index.php and I'm stuck on
I am working with Naive Bayesian classifier over PHP ( http://www.xhtml.net/php/PHPNaiveBayesianFilter ) And there's
I'm working on converting some NSURLConnection code over to AFNetworking and I'm seeing a
I've been working on an application for a little over two years and have
I'm working on a web based application which uses a JSON over HTTP based
I've been working on a long-term project for over a year now and love

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.