Questions tagged [sqlite3]

0

votes
0

answer
20

Views

SQLite3 - Select returns bad data

I have a problem without my simply database. I have defined (fields - text, decimal, data) the sales table in the database. I load data into it (code). The problem is that: Select sum(salesvalue) from sales it shows bad data. The sum is too small in relation to reality. 'Salesvalue' -> DECIMAL Inter...
Qlikeers
1

votes
1

answer
31

Views

Difference between two dates in Sqlite3

I work in Sqlite3 and tried DATEDIFF(days, listing_date, sale_date) But it didn't work. What is the correct way to take a difference between two columns which are timestamps in Sqlite3? id listing_date sale_date 1 2012/02/27 2020/02/27 2 2011/06/27 2020/02/17 3 2008/08/03 2...
Ewa Szyszka
0

votes
0

answer
6

Views

Python - Django 1.5 Is there a possible workaround to fix database error

Im working a school management project and I integrated a forum app. It now pushes a database error even after I migrated / synced the database. Are there possible workarounds? Request Method: GET Request URL: http://127.0.0.1:8000/admin/forums/category/add/ Django Version: 1.5.12 Excepti...
Dre James
1

votes
1

answer
10

Views

sqlite3 error on AWS lambda with Python 3.6

I try to run a lambda function on python3.6. I got the following error message: sqlite3 module is required for the SqliteCache: RuntimeError What confused me is that sqlite3 is a default module in python3, so how to install sqlite3? I tried python3 -m pip install python3 -t ./. It will failed
Yang L
0

votes
0

answer
4

Views

Make SQLite errors specific and not just SQLITE_ERROR in express/node.js

So basically I have a similar block written in Express: var sqlite3 = require('sqlite3'); const data = {}; const db = new sqlite3.Database('sqlite/test.db'); db.run('INSERT INTO [Employees]([Name]) VALUES(?)', [name], function (err) { if (err) { //this is the error block data.err...
Abana Clara
1

votes
1

answer
337

Views

How to prevent insertion of invalid dates into a SQLite table?

SQLite tables can't have a column of type date or timestamp. Dates are stored as either text or a number. That being the case: How can I prevent an invalid date like February 31st from being inserted into a table? I'm know you can validate the date in the application before inserting, but that's no...
Tulains Córdova
0

votes
0

answer
6

Views

How fix “Database is locked” when UPDATE

i want to update datas from variable, but I don't know why, when I execute the command this error message is displayed : line 18, in save curseur.execute('UPDATE SAV SET Commentaires_SAV=(?)', (T_Comment.get('1.0', END),) ) sqlite3.OperationalError: database is locked I'm runing on Atom for the scri...
Florian.G
1

votes
1

answer
1k

Views

sqlite3 install issues on mac os sierra

Hi I am very new at what im doing here. I have tried following a couple different install guides for installing ruby on rails and seem to get stuck at the same point each time and it has to do with sqlite3 it gives me an error message that looks like this. I don't know how to uninstall it so I can t...
C Wagner
1

votes
1

answer
558

Views

Install npm sqlite3 on Windows for Electron App

I have a problem installing sqlite3 with npm in windows for an electron app. I installed sqlite3 with npm: npm i sqlite3 Then I executed: .\node_modules\.bin\electron-rebuild.cmd And I have this error: × Rebuild Failed An unhandled error occurred inside electron-rebuild gyp info it worked if it end...
J_J
-1

votes
0

answer
20

Views

Populating form fields in ajax

I am trying to populate my form fields with AJAX when a request is being made. I was able to successfully made the request and fetched data, but the issue I am facing is that the input fields are not being populated. If I populate the return data into a div it will display but not displaying in a fo...
1

votes
1

answer
1.4k

Views

how to fix sqlite3 errors while trying to implement my DBAccess class

I am working on my database access class thats trying to make calls to the DB with sqlite3 functions but I am getting all of these errors, I'm just woundering if anyone has experienced these kinda of errors before or if they have any idea as to why they might be occurring. Undefined symbols: '_sqlit...
tinhead
1

votes
1

answer
1.4k

Views

I have a sqlite syntax error. What is incorrect?

I have a sqlite syntax error. What is incorrect? my code: + (void)insertUpdateCatalogTime:(NSString *)time { NSLog(@'%@', time); sqlite3 *database; if(sqlite3_open([DatabaseManager databasePath], &database) == SQLITE_OK) { const char *sqlStatement = [[NSString stringWithFormat:@'UPDATE t_catalog S...
Voloda2
1

votes
1

answer
144

Views

How to compile SQLite3 for Linux without warnings?

I am getting hundreds of these warnings when I compile my sqlite3.c file for linux. UATHelper: Packaging (Linux): C:\Users\pbssu\Desktop\Plugins\SQLite3UE4Plugin\Source\SQLite3UE4Plugin\Private\sqlite3.c(17134,5): warning: 'SQLITE_OMIT_AUTHORIZATION' is not defined, evaluates to 0 [-Wundef] UATHe...
Ryan Glen
1

votes
2

answer
130

Views

Summing numbers from a Python SQLite3 Query

I would like to do some math with numbers I have stored in an SQLite database. My query seems to work. My issue is having python treat the numbers that I have queryed from the database as numbers. The first definition selects a unique row from my database. The second definition cycles thru a number...
Michael Crowne
1

votes
1

answer
55

Views

How to pass the values recieved from sqlite3 to Twython object in Python

I have a sqlite3 DB with Consumer Key, Consumer Secret, Access Token, Access Token Secret. I'm SELECT'ing all the data and iterating through the cursor. While printing I get the data, but for some reason can't pass it to the twython object. This is the first code I tried: #!/usr/bin/env pythons from...
Rohit Nair
1

votes
2

answer
89

Views

Python3: Search List of tuples for values which have public IP addresses

I am attempting to write a script which pulls data from a sqlite3 db and outputs only specific data which is of interest. I have written a function: def get_ip(db_file): cur = con.cursor() cur.execute('select 'Computer Name','User', 'IP Address1', 'IP Address2', 'IP Address3', 'IP Address4' from Sep...
Ryan Horan
1

votes
2

answer
47

Views

sqlite3 selecting values based on python variables

I am trying to select a value from my python SQL table based on a variable that the user inputs, through Tkinter. My database has a column named employee_username and has the employee's usernames and their password in 1 row. Username is entered by the user in a tkinter window My code looks like this...
nhm64 rtwh
1

votes
1

answer
461

Views

Database is locked - how to fix?

I set fireBase in my project and in crashReporting show bellow errors : Exception java.lang.Throwable: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5): , while compiling: PRAGMA journal_mode ################################################################# Error Co...
1

votes
0

answer
238

Views

Enabling Rtree on sqlite3 python module

Trying to run the following code: conn.executescript(''' CREATE VIRTUAL TABLE Hashes USING rtree( gives the following error:sqlite3 operational error no such module: rtree To fix this, I have built the windows dll from the sqlite source with rtrees enabled. Where should i put the dll in order for...
rares123
1

votes
1

answer
511

Views

How to initialize a database just once on Python using SQLite 3?

I'm trying to make a python app where the user can add a row to a table and visualize all the rows. My problem is that it seems that every time I run the program, the database is created again, with no values. I say this because there is an autoincrement value that is always the same. When I write t...
Arturo Cuya
1

votes
1

answer
93

Views

Why does .fetchall() method return empty list in this situation?

basically the problem is that the fetch all method is returning an empty list , and Ive checked outside of this method to see if the values i entered witch is ronaldb and 123456 currently reside inside of the login TABLE and they do , so i believe there is something wrong with the signin_check me...
Ron Computing
1

votes
0

answer
38

Views

recursive sqlite query given a parent id

I have a sqlite database with this structure create table categories ( CategoryID integer not null primary key , CategoryName text not null , CategoryParentID integer null ,FOREIGN KEY (CategoryParentID) REFERENCES categories(CategoryID) ); And given a parent ID i want to have a...
user1547351
1

votes
1

answer
287

Views

Django migrate sqlite3 db to postgres Query invalid input syntax for integer: “none” error

My project use Django 2.0 database from sqlite migrate to postgresql 9.6.3, Run normal in sqilet, migrate to postgresql and running error. models.py : Class WechatPay(models.Model): user = models.CharField('网点', max_length=20, default='None') user_group = models.CharField('渠道', max_length=20...
Xie.YJ
1

votes
0

answer
113

Views

SQLite update query for Title Case or Proper Case?

I can't quite seem to figure out how to convert a text column of titles into Title Case, or sometimes referred to as Proper Case in SQLite. It doesn't seem to have a propercase() function. I've tried various combinations of upper() and lower() with substr() and text concatenation. But it only change...
cisconethead
1

votes
1

answer
15

Views

How to check which foreign key yelds the results

Let's suppose I have a database with 4 tables, for cataloguing books. For every book I want to store the title, one or more authors, and one or more translators. The structure is as follows: CREATE TABLE `book` ( `book_id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `title` TEXT ); CREATE T...
Hirabayashi Taro
1

votes
0

answer
617

Views

ReactJS Post with Express, GraphQL, and SQLite3

I am trying to post data to a SQLite DB from a form. Very new at React so please bear with me. Now in my Register.js form code, I have an action='/graphql'. I'm hung up on how exactly to route that POST to my graphql mutation code and ultimately to a SQLite insert (which I'm still missing I believe)...
Andrew Hummel
1

votes
0

answer
231

Views

Update data of a column without changing row in sqlite

Okay, so I have a table in a sqlite database. It has a table with two columns: one column should contain a string data and the other column should have an int data. Now, I have a button that increments an initialized integer 'i' and every time I click this increment button, i gets stored in the seco...
dydx
1

votes
1

answer
237

Views

How can I use Sequelize and SQLite3 with NWJS 0.28.0?

NWJS version 0.28.0 runs with NodeJS v9.4 and SQlite3 package is only compatible up to v7.x. How can I use SQLite and Sequelize with v0.28? The command I have to compile SQlite is npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target='' But no matter which target...
Jeremy Dicaire
1

votes
0

answer
65

Views

SQLite + Trigger + Multiple Statements

I have a trigger setup as such: the first statement in the trigger increments a revision number the second statement in the trigger insert data into another table -- one item being the new revision number. I'm noticing that that new.revision still reflects the old revision number (i.e. before the fi...
Paul Calabro
1

votes
0

answer
29

Views

Writing full data to file

I have a python script that parses data from an SQLite DB table and writes it to a text file. It is working but it keeps writing the last line over and over again. I have tried to use the 'a+' parameter to append onto the file but it seems to miss everything before that and write only the last line...
GreenCoder90
1

votes
1

answer
627

Views

sqlite, update column from column in another table

I'm currently working on a query that updates table1.state from data in table2.state based on the city field in both tables. To put it another way, When city fields in table1 and table2 match, update table1 with the state from table2. The problem I'm running into is when there isn't a city match, a...
grigs
1

votes
0

answer
59

Views

JavaFX - can't query username at login

I have a problem with my login app, when a user tries to log I see this error: Exception in thread 'JavaFX Application Thread' java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774) at javafx.fxml.FXMLLoader$Contro...
Viti
1

votes
0

answer
307

Views

Pandas to_sql error - 'Error binding parameter 0 - probably unsupported type'

I am trying to push a pandas dataframe to an existing sqlite database. I am getting the following error: pandas.io.sql.DatabaseError: Execution failed on sql 'SELECT name FROM sqlite_master WHERE type='table' AND name=?;': Error binding parameter 0 - probably unsupported type. I would like to push t...
avocet
1

votes
0

answer
143

Views

The best practice of saving single-write insert-only many-entry narrow-table db in sqlite

I use sqlite 3.12 to save data. The data has only one writer there is no other reader to access the data before the write is done has only insertion. There is no deletion. During insertion, the writer does not query the data either. My plain data size is like 1G. It is like a narrow table with 2-3...
Joe C
0

votes
1

answer
262

Views

Change SQLITE_LIMIT_SQL_LENGTH for inserting large items at the same time - Sqlite3

I've had difficult to set new limit for sql length in the sqlite (version 3.10.2). I read the sql documentation and I noticed there is a function that allows to change the limit: sqlite3_limit(db,SQLITE_LIMIT_SQL_LENGTH,size) However, this function is for C interface. I'd like to know if there is a...
Kadu
1

votes
0

answer
17

Views

Sqlite3 ConnectionString not found

I am learning how to connect to a database for my future classes in University. I started today but I keep on getting errors when I try to test the connection of my database. My question is what parameter does the DriverManager.getConnection take specifically. I have tried multiple different paths...
moee
1

votes
1

answer
78

Views

How to check return value of sqlite3

I am working on sqlite3 from a bash script on Linux and trying to figure things out. when I open a database like this: sqlite3> .open contacts.db How I know what is the return value, it does not return anything even if the database does not exist.. Also, what is the return value of the query like:...
Ameer Mutlaq
1

votes
2

answer
153

Views

how to Subtract 2 Columns in SQLite?

If given the table: games_played(ID,home_team,away_team,homescore,awayscore) inputs: ('1', 'USA', 'CAN', '0','2') ('2', 'USA', 'CAN', '1','2') ('3', 'USA', 'CAN', '3','0') ('4', 'SWE', 'CAN', '3','2') ('5', 'CAN', 'RUS', '3','2') ('6', 'DE', 'RUS', '0','2') Output should be the teams: SWE, CAN What...
s878
1

votes
1

answer
52

Views

An SQLite3 query is running nearly instantaneous on some versions of a database, but takes orders of magnitude longer on others

I am old-fashioned and have been using Banshee as my primary music player for years. Luckily I am mostly happy with it, except for a certain issue I've been debugging for the past few days, in which, when shuffling to a new track on a playlist, it will freeze and have high CPU usage for a significan...
David Pitchford
1

votes
0

answer
78

Views

ERROR (java.sql.SQLException)

i am tryin to use sqlite-jdbc in android but give me error when trying to connect to database. below my code . Class .forName('org.sqlite.JDBC').newInstance(); c = DriverManager.getConnection('jdbc:sqlite:category1.db'); } catch ( Exception e ) { System.err.println( e.getClass().getName() + ': ' +...

View additional questions