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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:02:32+00:00 2026-05-18T04:02:32+00:00

in Python 2.6.5 with sqlite3.version 2.4.1, I use the following code: c = conn.cursor()

  • 0

in Python 2.6.5 with sqlite3.version 2.4.1, I use the following code:

c = conn.cursor()

# Create table
c.execute('''create table stocks
(date text, trans text, symbol text,
 qty real, price real)''')

# Insert a row of data
c.execute("""insert into stocks
          values ('2006-01-05','BUY','RHAT',100,35.14)""")

# Save (commit) the changes
conn.commit()

c.execute('''insert into stocks values(date=?, trans=?, symbol=?, qty=?, price=?
)''', ('08-26-1984', 'SELL', 'GOGL', 3, 400.00))

# We can also close the cursor 

if we are done with it
c.close()

And it throws an error:

Traceback (most recent call last):
  File "dbtest.py", line 18, in <module>
    c.execute('''insert into stocks values(date=?, trans=?, symbol=?, qty=?, price=?)''', ('08-26-1984', 'SELL', 'GOGL', 3, 400.00))
sqlite3.OperationalError: no such column: date

My question – what the heck??? I created a column with the name “date”! I’ve spend the last two hours trying to figure out what in the world is wrong and I’m getting really frustrated. Also, when I try to open it by command line, I’m told:

Unable to open database “orders”: file
is encrypted or is not a database

ANY help would be greatly appreciated as I’m about to put my computer through a wall.

Thanks!

  • 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-05-18T04:02:33+00:00Added an answer on May 18, 2026 at 4:02 am

    Incorrect syntax for that insert statement. This will work:

    >>> c.execute('''insert into stocks 
                     (date, trans, symbol, qty, price)values(?,?,?,?,?)''', 
                     ('08-26-1984', 'SELL', 'GOGL', 3, 400.00))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Python to track the version between local SQLite and remote web page.
Using SQLite3 with Python 2.5, I'm trying to iterate through a list and pull
I am using sqlite with python. When i insert into table A i need
Python gives us the ability to create 'private' methods and variables within a class
I'm using Java Scripting API to execute some external Python scripts from my Java
Im currently learning SQLite3 with Python. I'm looking at the manual, and it tells
I'm trying to convert a SQLite 2 file to SQLite3 using Python on Windows.
I am using sqlite with python 2.5. I get a sqlite error with the
I have created a Python module that creates and populates several SQLite tables. Now,
Which language for quick GUI app + sqlite database CRUD (2-4 tables). Java, Python?

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.