sqlite

NHibernate and SQLite exception

When i try to deploy mapped table into database with GenerateSchema..i get the exception: NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SQLiteDriver. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.HibernateException: The I...

insert/select with a condition

I'm not sure if this is possible but is there a way to select A unless its null then select B instead? I am writing a trigger, my code is insert into tbl_a(userid, obj) select p.author, new.id FROM user_comment AS p WHERE p.id=new.parent however new.parent is a nullable long (i'll switch to foreign key once supported in system.data...

Copying data to the Application Data folder on the iPhone

I am in the process of (finally) loading my App onto an iPhone device for testing. So far I have only tested the App in the simulator. The application is data-centric and uses an SQLite database. I have created an appropriate SQLite database with sample data which I used in the simulator. How can I copy this .sqlite3 file to the actual i...

Seeding SQLite RANDOM()

Does SQLite support seeding the RANDOM() function the same way MySQL does with RAND()? $query = "SELECT * FROM table ORDER BY RAND(" . date('Ymd') . ") LIMIT 1;"; From the MySQL Manual about RAND(N): If a constant integer argument N is specified, it is used as the seed value, which produces a repeatable sequence of column va...

delete a trigger sqlite

How do i delete a trigger in sqlite? ...

select from null?

I am writing a trigger and i need 2 tables. new/old which already exist and p for the parent. However p may be null so if i do a select new.a, new.b, ifnull(p.name, new.c) from p i'll get 0 results. if p is null. So how do i solve this? can i select from null or something else and left join p and use ifnull? i am not sure how to do t...

iPhone Sqlite access issue

Hi all, I have build an iPhone app which is currently in the app store and I am preparing an update for it. The app saves information in a sqlite database and because the DB structure has changed significantly in the update I am now trying to migrate the information from the old DB to the new one. Everything works smoothly when I do t...

SQLite: extended field description

In MS-SQL a field can have a description: Name: FName Description: First Name Can a SqLite - table have the same?? Thank you! Reinhard ...

Unable to open database SQLITE iPhone

Hi there, I am using SQLITE database in my iPhone app. I have a refresh button on my home screen and on click of that refresh button I usually fetch the data from my web service and store it into my database. In normal scenario it works fine but when I click my refresh button 4-5 times frequently my app crashes and My app log Shows "Unab...

NHibernate Concurrency Issue

Over the weekend I realized that an application I'm working on which uses NHibernate as an ORM to a sqlite database has a concurrency issue. I'm essentially looping through a collection in javascript and executing the following: var item = new Item(); item.id = 1; item.name = 2; $.post("Item/Save", $.toJSON(item), function(data, testSt...

insert a picture into database(sqlite) with java code. what should i do?

in the sqlite database, i set a field typed blob. then, i wrote java code: PreparedStatement preStmt = con.prepareStatement("INSERT INTO zz(pic) VALUES(?)"); preStmt.setBinaryStream(1, new FileInputStream(file), file.length()); i got a exception: java.lang.AbstractMethodError: org.sqlite.PrepStmt.setBinaryStream(ILjava/io/InputStrea...

can sqlite load 10M data into the memory.

If it's possible, how ? I want to speed up the readings (not writings) in sqlite Thanks ...

SQLite select next and previous row based on a where clause

I want to be able to get the next and previous row using SQLite. id statusid date 168 1 2010-01-28 16:42:27.167 164 1 2010-01-28 08:52:07.207 163 1 2010-01-28 08:51:20.813 161 1 2010-01-28 07:10:35.373 160 1 2010-01-27 16:09:32.550 46 2 2010-01-30 17:13:45.750 145 2 2010-01-30 17:13:42.607 142 2 2010-01-30 16:11:58.0...

SQLite java memory usage increases until an outofmemory exception

I use SQLite in a java program. While the java program runs, several queries are sent to the database as well as temporary tables are created in memory and then deleted (using DROP). The problem is that while the number of various operations in the database increases, the memory usage from the java program also increases. As a result, ...

Python tables <-> sqlite Rosetta stone ?

Is there a "Rosetta stone" which shows how to use Python tables of namedtuples in sqlite3 ? Say we have a namedtuple Row and a list or dict rows: Row = namedtuple( "Row", "name city x y" ) rows = [None, Row( "Jones", "Boston", 3, 4 ), Row(...) ... ] # translate the following to sqlite please -- rows[id] rows[id] = Row(...) rows.ap...

LIttle problem with Flex and sqlite query?

Just a quick question about a small problem I'm having with a flex app I'm creating. Its my first time tying to create an app using a local database and I'm getting an error in my query. private function emptyrow(eventObj:CloseEvent):void { var stmt:SQLStatement = new SQLStatement(); id = datagrid_id....

How to create a new datebase(named xx.db) using python and sqlite3

import sqlite3 conn = sqlite3.connect(r"D:\aaa.db") Is there a way to automatically create the db file if it doesn't already exist when I connect to it? thanks ...

How to load a sqlite db into memory using pysqlite

It is very important to me. Thanks. ...

Populating Spinner From SQLite Database Android

I'm attempting to make a dynamic drop down that will be filled by a SQLite table. I have a Cursor object which I can pull the data I need from. I've been able to accomplish loading the values into the drop down with the code below: Spinner s = (Spinner) findViewById(R.id.spinner); ArrayAdapter adapter = new ArrayAdapter<String>(th...

Is there a sqlite entension for PHP in RedHat Enterprise Linux 5?

Hi, I'm trying to use some off-the-shelf PHP code in RHEL5 which requires the sqlite package (not the PDO one) but it appears this is not included in the base php5.1.6 rpm bundled with RHEL5. Unfortunately, due to circumstances beyond my control, I don't have access to the installation media or RHN access (don't ask). There doesn't app...