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 8875603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:00:55+00:00 2026-06-14T19:00:55+00:00

so i am able to create a new table in my database and harvest

  • 0

so i am able to create a new table in my database and harvest all the information from a file to fill all but the last column in the table using cursor, and execute as one would normally do.

the last column of information comes from a different source and is in my code as a list of integers. how would i go about adding this list of integers into my last column?

i’ve tried various loops and iterations, but i am just missing something (probably quite obvious) in how to phrase it properly.

connection = sqlite3.connect('database.db')
cursor = connection.cursor()
for j in list:
    cursor.execute('insert into Table (column) values (?)', j)
connection.commit()

and i get the following error:

Traceback (most recent call last):
  File "Homework/Homework7/bam_counting.py", line 157, in <module>
    cursor.execute('insert into Genes (counts) values (?)', j)
ValueError: parameters are of unsupported type
  • 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-14T19:00:56+00:00Added an answer on June 14, 2026 at 7:00 pm

    If you use INSERT INTO... then sqlite will create a new row.
    You must use UPDATE table ... to update rows that already exist.

    You will need to tell sqlite which row to add the new column value to.
    Typically, you would do it with a SQL statement like

    UPDATE Table SET column = ? WHERE column2 = ?
    

    where column2 is some other column in the table.

    So something like this is slow but possible:

    cursor.execute('SELECT column2 FROM Table ORDER BY column2')
    column2 = [row[0] for row in cursor]
    for j, c in zip(lst, column2):
        cursor.execute('UPDATE Table SET column = ? WHERE column2 = ?', [j, c])
    

    A better solution (if possible) is to hold off INSERTing into the table until you’ve assembled all the information needed and then doing a single INSERT.


    PS. If you re-arrange your program to collect all the data to be inserted into a list of rows, args, then you can call

    cursor.executemany('INSERT INTO ...', args)
    

    which will be faster than many calls to cursor.execute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I create a new table im not able to select something from it
I'm able to create an excel file using apache poi. however, i want users
I am able to create a UIImage from a Core Animation layer using the
I am able to create a connection to a local sqlite3 database ( Using
I'm trying to create a new table in postgres but when I do it
I want to create a new row in my database on a table that
In my windows 2003 box, I am not able to create new web applications.
I am new to java based web service. I am able to create web
When a new item is created using Tastypie, I want to be able to
Function constructors are able to create objects in javascript but I have a more

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.