Re: [sqlite] Raise is not working

2009-07-12 Thread Simon Slavin
On 13 Jul 2009, at 2:17am, Jim Showalter wrote: > However, calling insertOrThrow raises SQLiteConstraintException, which > does not contain the text of the raise specified in the schema. > Instead, it just has: > error code 19: constraint failed > > > > Is there any way to get SQLite to honor

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
I'm defining the text of the error message in the schema, in the definition of raise, in the trigger definition: create trigger fki_definitions_words_id before insert on definitions for each row begin select raise (rollback, 'insert on table definitions violates foreign-key constraint

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
However, calling insertOrThrow raises SQLiteConstraintException, which does not contain the text of the raise specified in the schema. Instead, it just has: error code 19: constraint failed Is there any way to get SQLite to honor the message in the raise in the schema definition? -

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
Nevermind--for whatever reason, Google saw fit to do this: /** * Convenience method for inserting a row into the database. * * @param table the table to insert the row into * @param nullColumnHack SQL doesn't allow inserting a completely empty row, *so if

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
Should have included the code that calls: long id = mDatabase.insert(tableName, null, contentValues); if (id == -1) { throw new AppException(message, ErrorCodes.INSERT_FAILED); } The AppException is thrown. But when insert returns -1, that just means there was an error. Where is the

[sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
Schema: create table words (_id integer primary key autoincrement, wordtext text not null unique); create table definitions (_id integer primary key autoincrement, owningWordId integer not null unique, deftext text not null); create trigger fki_definitions_words_id before insert on

Re: [sqlite] Number truncation problem in SQLite 3

2009-07-12 Thread Jim Showalter
I have found the problem. There was an incrementing trigger left in the database accidentally. - Original Message - From: "John Machin" To: "General Discussion of SQLite Database" Sent: Sunday, July 12, 2009 4:25 PM Subject: Re: [sqlite]

Re: [sqlite] Number truncation problem in SQLite 3

2009-07-12 Thread John Machin
On 13/07/2009 8:40 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Showalter wrote: >> create table words (_id integer primary key autoincrement, wordtext >> text not null unique, timestamp integer not null); >> >> public class Word >> { >> long _id; >>

Re: [sqlite] Number truncation problem in SQLite 3

2009-07-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Showalter wrote: > create table words (_id integer primary key autoincrement, wordtext > text not null unique, timestamp integer not null); > > public class Word > { > long _id; > String wordtext; > long timestamp; > } > >

[sqlite] Number truncation problem in SQLite 3

2009-07-12 Thread Jim Showalter
create table words (_id integer primary key autoincrement, wordtext text not null unique, timestamp integer not null); public class Word { long _id; String wordtext; long timestamp; } timestamp: before save: 1247435151517 after save : 1247435160847 64-bit max is:

Re: [sqlite] Updating a database by email

2009-07-12 Thread Bruce Robertson
> We use a system of updating an Sqlite database buit use port 80 to send > data in XML format. > > Is there a reason you have access to the email port and not the HTTP > port 80? It is very complex to identify a missing email but using port > 80 and HTTP the process is almost trivial > > Our

Re: [sqlite] How-to change column limit?

2009-07-12 Thread Jay A. Kreibich
On Sun, Jul 12, 2009 at 08:23:35AM -0400, Stephan Lindner scratched on the wall: > Dear all, > > Sorry ahead for a really trivial question, but I'm not very familiar > with sqlite and just can't figure it out ... > > I'm importing large survey files into sqlite, and I run into the > problem of

Re: [sqlite] Updating a database by email

2009-07-12 Thread John Stanton
We use a system of updating an Sqlite database buit use port 80 to send data in XML format. Is there a reason you have access to the email port and not the HTTP port 80? It is very complex to identify a missing email but using port 80 and HTTP the process is almost trivial Our system

Re: [sqlite] Updating a database by email

2009-07-12 Thread Sylvain Pointeau
... sorry, I forgot to mention to have an updatedBy column also having the computer name as a distinct valuefor knowing who updated the last one (and eventually an updatedTime to know when) Cheers, Sylvain On Sun, Jul 12, 2009 at 5:06 PM, Sylvain Pointeau < sylvain.point...@gmail.com> wrote: >

Re: [sqlite] Updating a database by email

2009-07-12 Thread Sylvain Pointeau
what about to use a unique identifier for each row?but a unique identifier like UUID in sqlserver or Quuid in Qt? as it is unique over the world it could be enough? at the worst case, prefix an id by the name of your machine if you have only 2 machines. then merge the records together? cheers,

Re: [sqlite] How-to change column limit?

2009-07-12 Thread John Machin
On 12/07/2009 10:23 PM, Stephan Lindner wrote: > > I'm importing large survey files into sqlite, and I run into the > problem of creating a table with too many columns, i.e. How many columns do you have? > bash$ sqlite3 < tables.sql > > produces > > bash$ SQL error near line 3: too many

Re: [sqlite] Updating a database by email

2009-07-12 Thread Simon Slavin
On 11 Jul 2009, at 8:03am, raf wrote: > you could also send individual sql statements via email but > email doesn't always arrive. that is a major problem. you > would need an acknowledgement and retry mechanism. perhaps > there's an april fool's RFC for implementing TCP/IP via email :) > > once

[sqlite] How-to change column limit?

2009-07-12 Thread Stephan Lindner
Dear all, Sorry ahead for a really trivial question, but I'm not very familiar with sqlite and just can't figure it out ... I'm importing large survey files into sqlite, and I run into the problem of creating a table with too many columns, i.e. bash$ sqlite3 < tables.sql produces bash$ SQL

[sqlite] "database is locked" error using lastest linux kernel

2009-07-12 Thread hua zhou
My problem is get a "database is locked" error using lastest linux kernel (above 2.6.28) ,  while the code can run smoothly on linux 2.6.26.2 kernel(vmware pc686 host) and on 2.6.26.3 kernel(arm9 embed system).   The problem code is: #if 1  if (sqlite3_exec(gJcDb, "PRAGMA cache_size = 4000",

[sqlite] "database is locked" error using lastest linux kernel

2009-07-12 Thread hua zhou
My problem is get a "database is locked" error using lastest linux kernel (above 2.6.28) ,  while the code can run smoothly on linux 2.6.26.2 kernel(vmware pc686 host) and on 2.6.26.3 kernel(arm9 embed system).   The problem code is: #if 1  if (sqlite3_exec(gJcDb, "PRAGMA cache_size = 4000",

Re: [sqlite] Updating a database by email

2009-07-12 Thread raf
Jim Dodgen wrote: > On Fri, Jul 10, 2009 at 9:16 PM, Bill Harris < > bill_har...@facilitatedsystems.com> wrote: > > > I have to coordinate a task list between two sites, and my only > > convenient connection between the two is email. MS Access 2007 offers > > an email insert and update feature,