Linked Questions

2 votes
2 answers
1k views

I have an sql table with 3 columns, none of which is UNIQUE ( but the pair name + role is ): Name | Role | Votes What I need to do is, write an sqllite query that stick to the following rules : If a ...
kaharas's user avatar
  • 607
2 votes
0 answers
3k views

What is wrong with this SQL line? I've verified the types are correct. c.execute('''INSERT into stock_table (item_name, stock, price) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE stock=VALUES(stock);'''...
gannonbarnett's user avatar
0 votes
1 answer
2k views

It would be helpful if someone could tell me correct syntax for updating tables in sqlite. I want to update table using sqlite but I am getting the following error: android.database.sqlite....
Devansh Jani's user avatar
0 votes
2 answers
1k views

I am attempting a prepared statement for the first time based on this thread. So far I am getting the error message SQLSTATE[HY000]: General error: 1 near "ON": syntax error Here is the query followed ...
Kurt Leadley's user avatar
-1 votes
1 answer
106 views

Im having a problem with my sqlite database in my python program. I'm trying to create a table that will hold records of players score. Player name is saved as variable "val" and that ...
Paproch's user avatar
0 votes
0 answers
76 views

There is a parser script in curl, as well as a script that creates a database and writes sparse data to this database. How to make sure that each time the script is run, the sparse data is not written ...
Aleks Manzur's user avatar
629 votes
19 answers
403k views

http://en.wikipedia.org/wiki/Upsert Insert Update stored proc on SQL Server Is there some clever way to do this in SQLite that I have not thought of? Basically I want to update three out of four ...
Mike Trader's user avatar
  • 8,714
102 votes
7 answers
144k views

I have 2 tables Source and Destination that have the same fields. ID and COUNTRY, though they both have other fields too that are not in common. I need to copy the Source.Country value to the ...
Ian Vink's user avatar
  • 69.1k
5 votes
2 answers
12k views

In my table, id is the primary key, but this code not working in sqlite3: insert into text (id,text) VALUES(150574,'Hello') ON DUPLICATE KEY UPDATE 'text' = 'good' Please help me.
Alireza's user avatar
  • 209
5 votes
1 answer
15k views

I want to update a row if it exists in the table else insert it in SQLite in single query. From SQLite documentation I found out that we can use REPLACE command for achieving this. I want to know how ...
Maverick's user avatar
  • 3,053
5 votes
2 answers
3k views

I am building Inventory Application using PhoneGap.In that i have one module STOCK for stock management. Stock Table Query CREATE TABLE STOCK ( sto_id INTEGER PRIMARY KEY AUTOINCREMENT, ...
Chintan Khetiya's user avatar
4 votes
2 answers
5k views

I'm looking for some help on how to do this in Python using sqlite3 Basically I have a process which downloads a DB (temp) and then needs to insert it's records into a 2nd identical DB (the main db).....
MikeM's user avatar
  • 182
5 votes
2 answers
4k views

I want to scrape some specific webpages on a regular basis (e.g. each hour). This I want to do with python. The scraped results should get inserted into an SQLite table. New info will be scraped but ...
beta's user avatar
  • 5,756
3 votes
3 answers
8k views

I have a table in SQLite 3: CREATE TABLE foo ( bar TEXT ); It always has 0 or 1 rows. I want to write a query which updates the row if there is 1 row and adds the row if there are 0. What is the ...
Alexey Romanov's user avatar
-1 votes
2 answers
5k views

Hey guys I have scoured the many other answers and am still unable to figure out this problem. statement.executeUpdate("CREATE TABLE IF NOT EXISTS recentlyWatched (fileName STRING NOT NULL, ...
Ash's user avatar
  • 31

15 30 50 per page