sqlite3

Selecting random in rails sqlite vs mysql

Hey guys, I'm trying to select random data from the database in Ruby on Rails. Unfortunately, sqlite and mysql use different names for the "random" function. Mysql uses rand(), sqlite use random(). I've been pretty happy using sqlite in my development environments so far, and I don't want to give it up for just this. So I have a soluti...

Sharing sqlite database between multiple Android Activities

Can two or more Android Activities open an sqlite3 database for write? I have two Activities that need to insert data into the same sqlite database. When the second Activity calls SQLiteOpenHelper.getWriteableDatabase() an IllegalStateException is thrown with the message "SQLiteDatabase created and never closed". I've been able to av...

Ruby on Rails SQLite problem on Windows 7 x64

When I try to do db:create on sqlite database with this db config using Windows 7 x64 development: adapter: sqlite3 database: db/development.sqlite3 timeout: 5000 I get this, kinda funny error unknown error C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize' C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `dlopen' C:/Ruby/lib/ruby/1.8...

iPhone + sqlite3 + not in query

Hello, I want to write a in query in my code. My query is something like: SELECT PlayerID, PlayerName, Type, BattingSkills, BallingSkills from Player where TeamId = 6 and PlayerID not in (163,174) order by battingSkills desc limit 4 In my xCode I am writing the query like below const char *sql = "SELECT PlayerID, Player...

Simple Forum Engine with Support for SQLite

I need a simple forum backed by a SQLite 3 database which I can easily integrate into my new project, something in the line of Vanilla forum. What do you suggest? ...

read double quotes and single quotes from Sqlite database.

Hi, In my application I am trying to read some data from sqlite database into UITextView. This text has double quotes as well as single quotes, for ex: she said : "Katie's purse has been lost" when I do this, I get strange characters in place of double and single quotes. Please help me with a solution to scrub these characters...

gem update sqlite3-ruby fails on Mac OS X 10.5.8

I was trying to get the latest ruby on rails for my Mac running OS X 10.5.8. All went well until I tried to update the sqlite3-ruby. I see that others have had similar problems, but they were on Windows. This is the error: sudo gem update sqlite3-ruby Updating installed gems Updating sqlite3-ruby Building native extensions. This could...

SQL query logging for SQLite?

I need to log queries from a number of applications that use SQLite. Introducing logging to the applications would in this case not be a feasible solution in practice. So how can I enable query logging in SQLite itself? ...

sqlite3 Operation Error when doing many commits rapidly

I get sqlite3.OperationalError: SQL logic error or missing database when I run an application I've been working on. What follows is a narrowed-down but complete sample that exhibits the problem for me. This sample uses two tables; one to store users and one to record whether user information is up-to-date in an external directory sy...

Does using the sqlite3 .import command overwrite data in the destination table?

Does the sqlite3 .import command used to import data from delimited text files append rows to existing content if the destination table is not empty, or does it clear the table first? ...

SQL Syntax error on table update

Hello all, Why is that I'm getting a syntax error on the following SQL statement under sqlite? Error reads: SQL Error: near "SET": syntax error UPDATE nova SET Nome = (select Nome from assessores where nova.ID = assessores.ID), SET Morada = (select Morada from assessores where nova.ID = assessores.ID), SET E...

Ruby/Rails/Mysql

I am on leopard. It comes with Ruby 1.8 & Sqlite3 pre-installed. I have updated ruby to 1.9.1 & added Mysql. Here's the problem. I cannot get the path to correctly point to ruby 1.9.1. I tried to update the sym-link to no avail. I am able to get into Mysql from the terminal but I cannot connect to the server through Ruby because Sqlite3 ...

How do I use the SQLite3 import command using the C API?

I have the following code: int rc; rc = sqlite3_exec(sqlite3_database, ".import mydata.csv mytable", callback, 0, &errMsg); After this gets run, errMsg contains this error message: near ".": syntax error I assume that it does not recognize the import command. However, this command works when running it from the sqlite3 program on t...

sqlite3 file import

is here a way to import a file into table with ":" being the separator? for example I have file test.txt with value1:result1 value2:result2 want to use something like this on the CLI: sqlite> .import test.txt table and at the end I would have: +--------------+ |value1|result1| +------+-------+ |value2|result2| +------+-------+ ...

Increasing memory usage in sqlite3 ?

I've written a console app which receives events via boost::interprocess memory and dumps the info into an sqlite3 database. While running the app I've noticed that, in the Windows task manager, the memory usage was cyclically increasing every... 30s-1min. This led me to believe that the problem lies within the main loop in which I execu...

Problem pushing sqlite3 db to heroku: lib/taps/schema.rb:30:in `sqlite_config': undefined method `[]' for nil:NilClass (NoMethodError)

I have a Sinatra DataMapper app hitting a sqlite3 database that I am attempting to deploy to Heroku. First pass, I included my database file in the git repo. This works, as in the app runs, but production data does not belong in the repository. It doesn't really work though because the database is read-only. I then removed the db fil...

iPhone + SQLite3 + fetch date column

Hi, I am having a date column in my table and I want to fetch that in iPhone application, I use following method to fetch values: objPlayer.type = sqlite3_column_int(selectstmt, 1); Now I can't find something like sqlite3_column_date. Which is the method I can use for this purpose. ...

SQL combining GROUP BY and SUM

I need help with SQL. I have an sqlite table like so; CREATE TABLE mytable (datetime DATE, type TEXT, amount REAL) I need a query which would sum up amount for each type AND year-month (as you can see the year is also extracted since the data can span several years). I've come to something half-way, but I'm a bit rusty on SQL. sqlite...

Debugging SQLite statements

I have this SQL statement running on my database and I'm sure it's right, but it's not making any change to the database. How can I debug it? The query: UPDATE task SET name=?, description=?, startDate=?, dueDate=?, complete=?, status=?, percentComplete=?, taskType=? WHERE rowId=:rowId I conditionally bind the first 8 parameters dep...

SQLite3 helper?

Is there any application like SQL Buddy for SQLite3 for Mac. I am just starting with Ruby on Rails and have my environment set up on my Mac running Snow Leopard, I have used SQL Buddy before and I was wondering if anyone knows anything like that for SQLite3. ...