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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:57:30+00:00 2026-06-09T02:57:30+00:00

I seem to be getting a rather odd error. And, for the life of

  • 0

I seem to be getting a rather odd error. And, for the life of me I can’t figure out what’s wrong. But on a piece of SQLite code, I’m getting this error:

Traceback (most recent call last):
  File "test.py", line 38, in <module>
    populateTables()
  File "test.py", line 20, in populateTables
    curs.execute("SELECT * FROM tracks WHERE ISRC = " + line[8])
sqlite3.OperationalError: no such column: USTCZ0993316

The odd part is that USTCZ0993316 is a piece of data that I want to compare to. I don’t know why it seems to think it is a column. Here is a much small version that gives the same issue.

import sqlite3
import csv

def tableSetup(name):
    if(name=="tracks"):
        curs.execute("CREATE TABLE tracks(id INT UNIQUE, name TINYTEXT, album_id INT, client_id INT, acr_record_num INT, ISRC TINYTEXT UNIQUE, track_length TINYTEXT, client_share FLOAT)")

def populateTables():
    tracks_csv=csv.reader(open('tables/tracks.csv', 'rU'), delimiter=";", quotechar='"')
    tracks_csv.next()
    for line in tracks_csv:
        curs.execute("SELECT * FROM tracks WHERE id = " + line[0])
        if not curs.fetchall():
            if "\"" in line[1]:
                line[1]=line[1].replace("\"","'")
            curs.execute("INSERT INTO tracks VALUES("+line[0]+",\""+line[1]+"\","+line[2]+","+line[3]+","+line[4]+",\""+line[5]+"\",\""+line[7]+"\","+line[12]+")")
    override_csv=csv.reader(open('tables/artist_override.csv', 'rU'), delimiter=",", quotechar='"')
    override_csv.next()
    for line in override_csv:
        curs.execute("SELECT * FROM tracks WHERE ISRC = " + line[8])
        print curs.fetchone()

#Set required Table Names
tables = ["tracks"]
testOut=open('tables/testOut.txt','w')
conn = sqlite3.connect('tables/test.db')

curs = conn.cursor()

# Create table if they don't already exist
curs.execute("SELECT name FROM sqlite_master WHERE type='table'")
tableResults = curs.fetchall()
print
for table in tables:
    if not any(table == result[0] for result in tableResults):
        tableSetup(table)

populateTables()
conn.commit()
curs.close()
  • 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-09T02:57:32+00:00Added an answer on June 9, 2026 at 2:57 am

    If it doesn’t have quotes then it’s a column or a number.

    curs.execute("SELECT * FROM tracks WHERE ISRC = ?", (line[8],))
    

    [Edit: “%s” isn’t proper syntax. It should be “?”. Also, if you’re going to be condescending, at least be right about it.]

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

Sidebar

Related Questions

I'm getting the following error message and I can't seem to figure out the
I cannot seem to figure out I am getting the following error in IE
This may seem like a simple question but i am getting an error when
This must be rather trivial and straight forward, but I cannot figure it out.
I can't seem to figure out why I am getting an InvalidCastException running the
I've been coding for a while now but seem to be getting this issue
I'm stumbling out of the blocks on this one. I can't get this code
if someone could tell me what is wrong with this rather simple code inside
I've been glancing at this code for a while now, and I can't seem
I seem to be getting this particular always when i am trying to receive

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.