Questions tagged [sqlite]

23140 questions
1

votes
0

answer
97

Views

Store image in sqlite from variable

I created this database public void onCreate(SQLiteDatabase db) { String query='CREATE TABLE '+tableName+' ( ID INTEGER PRIMARY KEY AUTOINCREMENT, ' + col1+' INTEGER, '+col2+' String, '+col3+' String, '+col4+' String );'; db.execSQL(query); } to sotre an image with some informations in a list I get...
Hossame Makhlof
1

votes
1

answer
71

Views

Retrieve multiple rowids in SQLite insert or update, using JavaScript

I know SQLite have last_insert_rowid() function. I'd like to create a similar function but I want to retrieve an array of indexes, each one coming from an insert or update into my db. To be clearer, I have a populated table like this (name is UNIQUE): rowid name age 1 'John' 18 2 'Anne'...
Zappescu
1

votes
1

answer
97

Views

Password recovery using email

I have a table called users with 3 columns (username, password, email). When a user forgets his password, he needs to insert his email to receive his password by email (password recovery). I have two questions: Why do I always get the message User does not exist? In the second observe, is there a mo...
Ester Silva
1

votes
2

answer
291

Views

cant get row from sqlite

this is how I save sqlite data from non activity class using getApplicationContext() public class SaveInSQLiteContacts { private Context context; public SaveInSQLiteContacts(Context context){ this.context = context; } public void save(String name, String imageKey, String email, String phone, String...
1

votes
3

answer
63

Views

Add columns of old purchases per customer to compare them

Reading a book on Sqlite and decided to test certain queries for fun. This one got me thinking. How would you return the number of the continuous buyers who got a new item with a lower price than their previous item? no joins required its all in the same table. relevant table names: day: date bought...
J_p
1

votes
0

answer
16

Views

SQLite syntax error but the statement is perfectly correct

I want to make a normal insert into a database, or just select one. But I can't do that, there is always an error. Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near 'ScientistRick': syntax error) at org.sqlite.core.DB.newSQLException(DB.java:941) ~ [spigot.ja...
1

votes
1

answer
390

Views

Where to store Windows Service configuration file

I'm creating a Windows Service in C++ that acts as a server. I need to store some configuration values (listening interface, ports) in a text file and other settings and users in a SQLite-Database file. Should I use the AppData folder or System32, because that's the default Windows Service working d...
Loris156
1

votes
1

answer
77

Views

Content Provider transaction around multiple methods

I need to create a Content Provider transaction around two methods that I didn't create but should use. Method addDog(Context, Dog) throws Exception adds a row in the Dog table. Method addToy(Context,Toy, long dogId) throws Exception adds a row in the Toy table. I would like to create a method publ...
salyela
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
0

answer
144

Views

Sometimes Getting empty DataFrame while using SQL query through pandas.read_sql_query

The below code is working fine when I run it, but sometimes it returns empty DataFrame. The table contains 2 million rows. conn = sqlite3.connect('somedatabase.db') exp = input('Enter Date') df = pd.read_sql_query('SELECT SYMBOL,TIME_STAMP,OPTION_TYP,STRIKE_PR,OPEN_INT,CONTRACTS,EXPIRY_DT FROM datat...
aditass
1

votes
0

answer
224

Views

SQlitedatabase unable to update and delete row

I am working with Xamarin forms and I have implemented SQLite database using Sqlite-net-pcl nuget package. The problem is that the database is initially saving a row but is unable to update or delete any row. Here is the code in which I save and delete the database row with a Key. public Task SaveI...
Anshuman Singh
1

votes
1

answer
21

Views

non-aggregate min() with NULLs

I am using the the multi-argument form of min but some values are NULL. For example: SELECT min(1,2,NULL); How do I update this query to ignore NULLs and return the desired value 1?
William Entriken
1

votes
1

answer
406

Views

Xamarin Forms - SQLITE Query

I'm sorry it's pretty simple but I just couldn't get my head around it. I've checked the internet and search for answers but I couldn't find a specific one for my question or I just don't know how to look for it. I'm fairly new in Xamarin Forms and I'm stuck with this problem with using SQLite; I am...
joppiealiw
1

votes
1

answer
48

Views

update with self join results in NULLs

I am moving from Access to SQLite. I am trying to recreate this update query: Access UPDATE FF_WBS_CONSOL INNER JOIN FF_WBS_CONSOL AS [FF_WBS_CONSOL_1] ON FF_WBS_CONSOL.ParentWBS = [FF_WBS_CONSOL_1].WBS SET FF_WBS_CONSOL.WBSLevel = [FF_WBS_CONSOL_1].[WBSLevel]+1 SQLite UPDATE [FF_WBS_CONSOL] SET [W...
midnite11
1

votes
0

answer
60

Views

Fill database table with data from config files on app startup

I want the initial database state in my yesod web app to be defined by config files that are parsed on app startup. My current approach to achieve this compiles, but doesn't seem to do anything, I suspect this is because the database may not be ready for use at that point or needs to be accessed dif...
Benjoyo
1

votes
0

answer
156

Views

Ionic 3 / TypeScript / Angular : how to handle SQLite database callbacks within FOR loop

I have following pages in my LibraryApp , developing using Ionic 3 framework CategoryPage : To add new record in Category table BookPage : To add new record in Book table Transaction: To add daily transaction where TrxType is either 'BookIssued' or 'BookReturned' CategorySummaryPage: summary for eac...
Nilesh
1

votes
1

answer
237

Views

FileNotFoundException when using SQLite-net-pcl

After adding SQLite-net.dll and using it, this error message is displayed. Visual Studio 2017 is in use as IDE. Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'SQLite-net, Version=1.1.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't e...
mnemonic
1

votes
0

answer
569

Views

PostgreSQL equivalent to SQLite ROWID

With the new IDENTITY type in Postgresql 10, I wonder if there is anything similar to ROWID in SQLite which is a pseudo-column to get the primary key. I want to do something like: SELECT ROWID FROM Table in Postgresql and get the primary key. Edit: This is not a duplicate of this question because RO...
antoyo
1

votes
0

answer
47

Views

Reading XML - how to?

I have an application that reads an xml file with sql statements and intends them in a sqlite database. So far everything has worked well. My problem starts when I change the android studio version to the last one. From there, it only reads half of each of the sql statements. For example the followi...
1

votes
0

answer
747

Views

create a table in sqllite by using a dataframe

I'm new to sqllite3 and trying to understand how to create a table in sql environment by using my existing dataframe. I already have a database that I created as 'pythonsqlite.db' #import my csv to python import pandas as pd my_data = pd.read_csv('my_input_file.csv') ## connect to database import sq...
Cagdas Kanar
1

votes
0

answer
287

Views

How to copy a .db file to-from 'www' folder with Cordova?(Android)

I'm using cordova-sqlite-ext to check and add information to a .db database, this works fine but now I must to copy pre-populated database (.db) to work with pre-populated information. I saw that according to cordova-sqlite-ext its necessary to have the .db file in the 'www' folder so I need 2 thing...
Alan Alvarez
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
43

Views

Unable to load DLL 'SQLite.Interop.dll' | Linux Deepin IDE: Jetbrain Rider

So on Windows 10 fall creator update, everything works fine But on Linux (Deepin 15.5 and Ubuntu 16.04) the SQLite.Interop.dll could not be found, when it the x86 and x64 folder are made with the interop.dll there as seen here in my screen cap
1

votes
1

answer
275

Views

Use SEE SQlite Encryption Extension in C#

I'm creating an SQLite database with ADO.NET usyng System.Data.SQLite, now I need to encrypt it using AES-256. I have access to SEE (SQLite Encryption Extension) and am looking on how to use it along with System.Data.SQLite. Previously we used Devart to handle the extension and encrypt the database...
roma8716
1

votes
1

answer
65

Views

On INSERT how do I retrieve ROWID or the AUTOINCREMENT value? [duplicate]

This question already has an answer here: How to retrieve the last autoincremented ID from a SQLite table? 5 answers I'm writing an INSERT using SQLite, and either I am using an AUTOINCREMENT or just going to use the ROWID as the primary key. Once the INSERT is performed, how do I find out what th...
Cyberherbalist
1

votes
1

answer
234

Views

Can't change journal mode in SQLite on Android

I'm using Android 6.0 and SQLite 3.8.10.2 I have a problem with changing journal mode for my db connection. Cursor cursor = null; cursor = mDatabase.rawQuery('PRAGMA journal_mode', null); Boolean d = cursor.moveToFirst(); String gg = cursor.getString(0); cursor.close(); mDatabase.rawQuery('PRAGMA jo...
GigaKatowice
1

votes
1

answer
56

Views

How can I use variables declared in javascript inside Java code?

I am making a website that gets some data from a database using SQLite. In order to connect to the database, I use the following Java code inside a jsp file. It creates an array that stores the information from the database. Next, I have this Javascript code that is supposed to change an element fro...
Smirlianos
1

votes
0

answer
24

Views

Objective C: Exported Sqlite to Email has incomplete Data

I am trying to export the sqlite that I've created for core data to store the records locally to the app that I am developing. I have managed to export the sqlite file via e-mail as attachment, but when I extracted the sqlite file the data is not complete, newly added records aren't shown. Here's my...
Risra
1

votes
0

answer
68

Views

SQLite Running Total Without Relying on RowId sequence

So I've been looking at this for the past week and learning. I'm used to SQL Server not SQLite. I understand RowId now, and that if I have an 'id' column of my own (for convenience) it will actually use RowId. I've done running totals in SQL Server using ROW_NUMBER, but that doesn't seem to be an op...
griftopia
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
82

Views

not able to delete row from SQLite Database

I created a SQLite Database app following new boston video tutorials . Everything is working fine except I can't delete any row from the database or table. The app is supposed to delete a product when I enter the name of the prduct and press the delete button but when I do that, nothing happens. Her...
Cersie
1

votes
0

answer
204

Views

SQLite - Database Locked when trying to set PRAGMA synchronous = OFF

So here is the scenario: We are adding a VACUUM routine and this appears to be working as expected. However, the journal file is not being removed unless we exit out of the application entirely. After googling many times, we tried a suggestion: after the VACUUM is completed we inserted a 'connection...
midnite11
1

votes
1

answer
76

Views

Core Data swift3 same primaryKey but different objectId in picker

I'm an absolute newbie with Swift and Core Data. I created a two Entity learning app, nothing special. I'm stuck in finding why (AFAICT) my 'Persona' picker objects in my 'Medicina' Entity are different from the ones shown directly in the 'Persona' Core Data table; since adding a predicate to filter...
elysch
1

votes
0

answer
151

Views

Import csv into SQLite without single quotes

I have a data in .csv file in format first_name,second_name,nick_name etc. and the values in .csv are stored with single qutoes for example 'John','Wick','Johny' I want to import these data into newly created SQL database but i want to get rid of these single quotes. I am importing this file into...
1

votes
0

answer
102

Views

SQLite INSERT INTO using SELECT and last_insert_rowid

I'm working on an SQLite based project to save tagged items. I create thee tables: item, tag and item_tag like so : CREATE TABLE 'item'(id INTEGER AUTOINCREMENT primary key, ...); CREATE TABLE 'tag'(name TEXT primary key); //
Ninfomane
1

votes
1

answer
38

Views

How to return value if there is no row?

I reading data from table through Qml + JS and I need to have 100 return is the query doesn't found data: SELECT (CASE WHEN pourcenthour < pourcentcycle AND pourcenthour < pourcentmonth THEN pourcenthour WHEN pourcentcycle < pourcenthour AND pourcentcycle < pourcentmonth THEN pourcentcycle WHEN pou...
Philippe
1

votes
2

answer
92

Views

Filtering: AODB vs Autofilter vs SQLite

I have an Excel sheet with data in about 100,000 rows, 16 columns. I have to extract data (one value from the 1 row I find) from this table a few thousand times. I have been using Autofilter to extract this value, but have also tried AODB/SQL statements to see if I can improve the speed of the queri...
asim1701
1

votes
0

answer
45

Views

How can I see the temp files that Vacuum creates in SQLite while running

I've read the information about where SQLite puts the temp files while vacuuming (https://sqlite.org/tempfiles.html), but I can't find the file while vacuum is running. I looked in SQLite source and it appears the temp file name is vacuum_db.*, but a find or locate did not display anything. I also...
user1838913
1

votes
1

answer
218

Views

Python: Get DISTINCT column values from inside CASE function in pandasql

I am trying to write a query in Python using pandasql. My code is as below, import pandas as pd from pandasql import * data = pd.read_csv('registerlog.csv') q = ''' SELECT a.RegistrationMonth, COUNT(DISTINCT a.UserID) AS UserSize, COUNT( CASE a.MonthDifference WHEN 0.0 THEN DISTINCT a.UserID ELSE NU...
Mano Prathibhan C
1

votes
1

answer
343

Views

Save a copy of sqlite file in Core Data

I am trying to make a copy of current Core Data database file. After doing some research, I found that migratePersistentStore(_:to:options:withType:) might be useful in this situation, as the Apple documentation saying, This method is typically used for “Save As” operations. While the document...
tttemplar

View additional questions