473,698 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLite OperationalErro r near "?"

Hello

I would like to use the safe "?" placeholder in my SQLite requests but
I got the following error:

Traceback (most recent call last):
(...)
cursor.execute( "SELECT ? FROM ? WHERE name = ? ", (key, self.table,
self.name))
OperationalErro r: near "?": syntax error

key, self.table and self.name are standart strings.

Any idea about how to solve this problem ?

Thanks in advance,

Hexade
Jun 27 '08 #1
2 7983
On Apr 13, 8:45 am, Hexade <hex...@gmail.c omwrote:
Hello

I would like to use the safe "?" placeholder in my SQLite requests but
I got the following error:

Traceback (most recent call last):
(...)
cursor.execute( "SELECT ? FROM ? WHERE name = ? ", (key, self.table,
self.name))
OperationalErro r: near "?": syntax error

key, self.table and self.name are standart strings.

Any idea about how to solve this problem ?
You may like to read the answer to the question on sqlite3 that was
posted 45 minutes before yours.
Jun 27 '08 #2
On 13 avr, 03:00, John Machin <sjmac...@lexic on.netwrote:
On Apr 13, 8:45 am, Hexade <hex...@gmail.c omwrote:
Hello
I would like to use the safe "?" placeholder in my SQLite requests but
I got the following error:
Traceback (most recent call last):
* (...)
* cursor.execute( "SELECT ? FROM ? WHERE name = ? ", (key, self.table,
self.name))
OperationalErro r: near "?": syntax error
key, self.table and self.name are standart strings.
Any idea about how to solve this problem ?

You may like to read the answer to the question on sqlite3 that was
posted 45 minutes before yours.
Thank you.

I guess you are speaking about
http://groups.google.com/group/comp....8ad977ed31e2a#
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
8538
by: Julien ARNOUX | last post by:
Hi, I'd like to use regular expressions in sqlite query, I using apsw module but it doesn't work...Can you help me ? My script: import apsw import re path = 'db/db.db3'
12
2481
by: John Salerno | last post by:
I've been looking around and reading, and I have a few more questions about SQLite in particular, as it relates to Python. 1. What is the current module to use for sqlite? sqlite3? or is that not out until Python 2.5? 2. What's the difference between sqlite and pysqlite? Do you need both, just one, or is one an older version of the same thing? 3. What's the difference between the command line program called sqlite3
5
4002
by: John Salerno | last post by:
Am I using the ? placeholder wrong in this example? t = ('hi', 'bye') self.connection.execute("INSERT INTO Personal (firstName, lastName) VALUES ?", t)
0
1281
by: Ben Wolfson | last post by:
I've got a db some of whose elements have been created automatically from filesystem data (whose encoding is iso-8859-1). If I try to select one of those elements using a standard SQL construct, things work fine: Butcher%",)).fetchall() But if I use the pysqlite recipe for searching with a regexp, things don't work: ('John Butcher',)).fetchall()
29
2358
by: dbhbarton | last post by:
Had a thought that's grown on me. No idea if it's original or not- too inexperienced in programming- but I guess there's no harm floating it out there. Python wins big on readability, and there's no doubt that context- dependent text formatting in IDEs (keywords, strings, comments etc) is a massive help too, therefore benefitting development and maintenance. This idea is in a similar vein, especially for when scripts grow large.
0
1436
by: smitty1e | last post by:
Disclaimer(s): the author is nobody's pythonista. This could probably be done more elegantly. The driver for the effort is to get PyMacs to work with new-style classes. This rendering stage stands alone, and might be used for other purposes. A subsequent post will show using the resulting file to produce (I think valid) .el trampoline signatures for PyMacs. If nothing else, it shows some python internals in an interesting way.
2
11003
by: Bob | last post by:
In our database code (we are using django v0.96) we wanted to catch and handle MySQL OperationalErrors. We use both the Django models and database connections. However, even though we confirmed that a _mysql_exceptions.OperationalError are raised (particularly 1213 deadlock), we cannot catch them with try/except. Here's the code that did not work:
0
1724
by: kurtf | last post by:
Hope somebody could help me with the creation of a table in sqlite3 from python. I am developing an application that allows a user to import a data file and insert the data into a sqlite3 database. I want the names of the fields to be derived from the first row of the file. I have been trying to perform this with code like: # CODE BEGIN import sqlite3
3
275
by: Daniel Fetchinson | last post by:
Does Python 2.5.2's embedded SQLite support full text searching? Sqlite itself is not distributed with python. Only a python db api compliant wrapper is part of the python stdlib and as such it is completely independent of the sqlite build. In other words, if your sqlite build supports full text searching you can use it through the python sqlite wrapper (that is part of the stdlib) and if it doesn't then not. This is true for any sqlite...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3051
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.