I have a PHP process running as a result of a JavaScript AJAX request, which is potentially running for some time and will produce data from time to time. From a usability perspective, I'd like to be able to return data to the JavaScript as soon as it's produced, but this appears not to be possible.
My workaround is to write it to an SQ...
Do you know of any SQLite alternatives (Portable/flatfile based/serverless) that have foreign key constraint and/or offer transaction support?
...
I'm using SQLite in an Android application.
In all of my tables I have a default row with an index of 0 that holds default values for that table.
In most situations the default number for each field is 0 and that is the best number to use.
However, when I sort my data using an ORDER BY statement I want to have all of my zero value fields...
I am trying to truncate dates to only get year/month as opposed to the form they are in which is year/month/day.time
What I want to do is count all of the cars that sold each month and all of the suvs that sold each month, having something like:
// counts cars
select SellDate, count(*)
from category
where machineIdentification =...
I need to apply two successive aggregate functions to a dataset (the sum of a series of averages), something that is easily and routinely done with common table expressions in SQL Server or another DBMS that supports CTEs. Unfortunately, I am currently stuck with SQLite which does not support CTEs. Is there an alternative or workaround...
I have a bunch of SQLite db files, and I need to merge them into one big db files.
How can I do that?
Added
Based on this, I guess those three commands should merge two db into one.
attach './abc2.db' as toMerge;
insert into test select * from toMerge.test
detach database toMerge
The problem is the db has PRIMARY KEY field, and ...
Hello,
I have two parts of a program (the actual app and a BroadcastReceiver) that could possibly try to connect to and modify a SQLite database and a SharedPreferences file.
1) I know you can make multiple connections to a single SQLite database. I also read that SQLite can "lock" the database when it attempts to modify or read from a...
Hi,
i have got a problem with my SQL Statement:
Table structure:
CREATE TABLE "tags" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"page_id" INTEGER NOT NULL,
"title" TEXT NOT NULL
);
Now i want to select all the tags from one page and the frequency of this tag in the whole database. I have the following SQL statement:
S...
I am trying to store a date from a DateField into an sqlite database, but can't figure out what format to store/retrieve it in to preserve the value. I have been trying with the sqlite datatype as 'timestamp' and using 'long' in the application. When I retrieve the date though, it goes to 1970 instead of 2010-ish. Any recommendations?...
Hi
I have the following calls (actually a few more than this - it's the overall method that's in question here):
ThreadPool.QueueUserWorkItem(Database.Instance.RefreshEventData);
ThreadPool.QueueUserWorkItem(Database.Instance.RefreshLocationData);
ThreadPool.QueueUserWorkItem(Database.Instance.RefreshActData);
1st point is - is it OK...
Hello,
I'm currently making an app where it would communicate with a simple database that will be hosted on a server. The database will only have three columns, a _id, title, and url link. I've successfully done this using the phone's local database using SQLiteDatabase but I want it so that any other phone can also access the same data...
Hi,
I'm trying to create a new SQLite database for the iPhone using SQLite Manager firefox add-on. From what I understand, Z_METADATA AND Z_PRIMARYKEY tables must be included. How do I configure these though? I've tried to replicate a database by adding the same columns in each of these tables (for Z_METADATA --> Z_VERSION, Z_UUID, Z_PLI...
I'm trying to use this code:
UPDATE media_items SET content_url = replace(content_url,’cd%20images’,'my%20music’);
And I know that the percent signs are mucking it up, and I have to use some sort of escape to get them to read properly, but I've done a bunch of searching, and anything I find doesn't seem to work. What is the proper sy...
I created an android app and there is a function that will periodically delete old records
delete from tablea where col1 = 'value1' and col2 = 'value2' and postdate < '2010-06-14'
It has performance problem when total number of row in tablea has more then 50,000. It take around 45 seconds to delete 500 records.
I already have index f...
I have a very large CSV file that I imported into a sqlite table. There are over 50 columns and I'd like to find all rows where any of the columns are null. Is this even possible? I'm just trying to save myself the time of writing out all of the 50 different columns in a where clause. Thanks.
...
Hi,
I have the same problem as in http://stackoverflow.com/questions/2280345/sqlite-database-leak-found-exception-in-android - I get "SQLiteDatabase created and never closed" although I close all my databases and cursors.
But I am new to java, can someone please help me implement the solution in my context?
since I am not using my own p...
Hi all
I created a sql lite database with the following columns:
static final String dbName="demoDB";
static final String tableName="Employees";
static final String colID="EmployeeID";
then
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL("CREATE TABLE "+tableName+" ("+...
Question: Is it possible to use a variable as your table name w/o having to use string constructors to do so?
Info:
I'm working on a project right now that catalogs data from a star simulation of mine. To do so I'm loading all the data into a sqlite database. It's working pretty well, but I've decided to add a lot more flexibility, ...
I am looking to add a (local, not online) high scores table to my Android app and I wanted to get some insight on the best way to approach the problem.
I have a list of users (right now being saved out to a file and read back in as an array of User objects), and the high scores need to reference this data to populate the table with the ...
Hello,
my rails application generates lots of small sqlite databases using DataMapper. After data saved, .sqlite-file must be uploaded on a remote server and destroyed locally.
My question is how to make DataMapper close .sqlite db connection and free repo's memory? Application should generate many databases, so it's important to save ...