sqlite3

Rails - generating .sqlite3-databases

Hi everybody. My rails app. uses mysql database and I need to generate .sqlite3.databases. Is it possible to use activerecord and rails models for it? We are trying now to use models namespaced by Remote:: module but by this way we can't start concurrent generators. ...

Python copy MySQL table to SQLite3

Hello, I've got a MySQL table with about ~10m rows. I created a parallel schema in SQLite3, and I'd like to copy the table somehow. Using Python seems like an acceptable solution, but this way -- # ... mysqlcursor.execute('SELECT * FROM tbl') rows = mysqlcursor.fetchall() # or mysqlcursor.fetchone() for row in rows: # ... insert r...

what happens when a sqlite3 db write is interupted?

Question: When does the actual writing to the sqlite3 db file take place and what happens if it is interrupted? Info: I have this program in python that I've been working on for a few weeks that uses sqlite3 to store large amounts of data from the simulation it is running. But there are two situations I'm worried about. We've been ...

Join with Pythons sqlite module is slower than doing it manually

I am using pythons built-in sqlite3 module to access a database. My query executes a join between a table of 150000 entries and a table of 40000 entries, the result contains about 150000 entries again. If I execute the query in the SQLite Manager it takes a few seconds, but if I execute the same query from python, it has not finished aft...

SQLITE and iPhone Input Sanitisation

Hi there, We are making our very first iPhone game, and if the user gets a high score then we need to let them enter their name to store it in the high-scores database inside the app. What I was wondering is how do we go about sanitising the input on the iPhone. Obviously we don't want them dropping tables when inputting their name! C...

Database for Windows Phone 7

I'm looking to release a really simple application for windows Phone 7. Unfortunately, My Apps need to store some data in the device. say a Database. My colleague found one SQLite library - http://sviluppomobile.blogspot.com/2010/03/sqlite-for-wp-7-series-proof-of-concept.html But How about Linq to SQL or EF for Windows Phone 7. Any L...

Netbeans + sqlite3 = Fail?

Hello, I've decided to give Python a try on Netbeans. The problem so far is when try to run program I know works, i.e. if I ran it through the terminal. For the project I selected the correct Python version (2.6.5). And received the following error: Traceback (most recent call last): File "/Users/XXX/NetBeansProjects/NewPythonPr...

Query to sort a field such that strings comes first and then numbers

I've a column in which contains numbers or strings. The type of the column is varchar. Usually when we sort it using the string field, then all the numbers come first and then strings start. But I want all the strings first and then numbers. TIA ! ...

Weird problem with a sqlite3-database (Can only write once)

Hey, i have a huge problem with my sqlite3 database on the iphone sdk 4. I can only write/read the database once! With the iphone sdk 3.2 everything had just worked fine. After the first try i get the errormessage "SQLITE_BUSY". Here's a snippet of my code i use: -(void) addFavoriteOdv:(Odv*)odv name:(NSString*)name; { @synchroni...

SQLite OLE DB driver for C++ (MFC)

I am looking for OLE DB driver to acces SQLite. Is there any? I need it to use under MFC, not .NET. I have found this but it is .NET driver: http://CherryCitySoftware.com/ccs/Home/Default.aspx and this but I have no references to this: http://www.newobjects.com/product.asp?Category=71 Thanks ...

Can SQLite handle 90 million records?

Or should I use a different hammer to fix this problem. I've got a very simple use-case for storing data, effectively a sparse matrix, which I've attempted to store in a SQLite database. I've created a table: create TABLE data ( id1 INTEGER KEY, timet INTEGER KEY, value REAL ) into which I insert a lot of data, (800 elements every 10...

Get table on the fly with sqlite

Hello, I've a code that display a list of items based on a custom adapter. To display a content of a table no problem but when I need to add a reference to many table it's another thing. Two solution are possible in my point of view: 1) Querying the database inside setViewValue (didn't investigate too much this possibility) or 2) Find ...

Accessing .sqlite file in Android 2.1

I have a .sqlite file with one table in it. i want to access this data. Please tell me, where to copy this .sqlite file (in eclipse project) and how to access the data from this .sqlite file. please suggest some code or liniks.. [i am using Android 2.1, dont know the database version..] Thank you.. ...

SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL

Hi..I am getting the following error while trying to add a NOT NULL column to an existing table. Why is it happening ?. I tried rake db:reset thinking that the existing records are the problem, but even after resetting the DB, the problem persists. Can you please help me figure this out. Thanks Migration File class AddDivisionIdToProfi...

Problem during SQLite3 installation on Windows XP

As shown in a blog I followed the instructions of setting up SQLite3 on my Windows, but after I pasted the necessary files in Bin folder of Ruby, which I downloaded from http://www.sqlite.org/download.html, I get the following error when I use the following commmands: C:\gem install sqlite3-ruby --version=1.2.3 ERROR: http://rubygems....

Problem in SQLite3 installation...

The following error comes up: C:\gem>gem install sqlite3-ruby --local Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. C:/Ruby/bin/ruby.exe extconf.rb checking for #include <sqlite3.h> ... no sqlite3.h is missing. Install SQLite3 from htt...

About layout change in SQLite

When I click the ListView in layout1, it will go to layout2 and show some imformation. But when I click the button I designed to back to layout1, I can't see the ListView. Just black background. Here is the Button code: Button backButton = (Button) findViewById(R.id.widget39); backButton.setOnClickListener(new Button.OnClickListener() ...

Index of substring in SQLite3?

What's the most straightforward way of finidng the index of a substring in a varchar column? charindex doesn't exist in the stock version of SQLite3 -- which is still a little surprising to me. Specifically, I have a column with values like 010000, 011000, 010110, etc. I want to find the index of the first occurence of 11. For the ex...

SQLite Trigger to Autoincrement one column when another is not unique

I am looking for a way to have a trigger that looks at a Timestamp field and if it finds a match autoincrement the record being inserted on another column. So I would have a timestamp field and a version field. If a record being inserted has a timestamp that matches a record already in the table then autoincrement the version field. A...

Is there a tool to profile sqlite queries?

I am using a SQLite database and would like to speed up my queries, perhaps with indexes or by restructuring them altogether. Is there a tool to profile queries, that might help me decide where things are slowing down? I know I could just enter queries into a tool like SQLite Administrator to time them, but I'm looking for something a ...