[sqlite] Shared binary plus static lib

2009-06-05 Thread Mark Constable
Howdy, I'd like to end up with a shared NON-threaded NON-TCL binary but also with a libsqlite3.a static lib. Could anyone suggest how I could alter this Makefile to support these requirements please? For x86_64 and i686, kernel 2.6.29.4, glibc 2.10.1. TOP = ../sqlite3 BCC = gcc -O2 USLEEP = -DHAV

Re: [sqlite] Expected behavior for begin exclusive?/database locked?

2009-06-05 Thread Rosemary Alles
I established re-try logic to get this to work. :( On Jun 5, 2009, at 7:08 PM, Rosemary Alles wrote: > > I have several (identical processors) accessing a sqlite3 database > over NFS. I have a busy handler (see below) and use "begin exclusive" > > Periodically I get the following error from f

[sqlite] Expected behavior for begin exclusive?/database locked?

2009-06-05 Thread Rosemary Alles
I have several (identical processors) accessing a sqlite3 database over NFS. I have a busy handler (see below) and use "begin exclusive" Periodically I get the following error from from sqlite3: Function:artd_sql_exec_stmt error in stmt:begin exclusive against database:/wise/fops/ref/artid/l

Re: [sqlite] Getting last inserted rowid?

2009-06-05 Thread Nuno Lucas
Last try... On Sat, Jun 6, 2009 at 1:30 AM, Nikolaus Rath wrote: > John Machin writes: >> On 6/06/2009 8:19 AM, Nikolaus Rath wrote: >>> John Machin writes: > Now I'm confused. I want to know if it will be sufficient to wrap my > last_insert_rowid() call between BEGIN .. and END in order

Re: [sqlite] Getting last inserted rowid?

2009-06-05 Thread Nikolaus Rath
John Machin writes: > On 6/06/2009 8:19 AM, Nikolaus Rath wrote: >> John Machin writes: Now I'm confused. I want to know if it will be sufficient to wrap my last_insert_rowid() call between BEGIN .. and END in order to make it return the rowid that was last inserted by the same thr

Re: [sqlite] Getting last inserted rowid?

2009-06-05 Thread Igor Tandetnik
Nikolaus Rath wrote: >>> Is BEGIN ... COMMIT sufficient for that? >> >> No. Transaction is also maintained per connection. Starting a >> transaction would prevent other connections from making concurrent >> changes, but wouldn't block other threads using the same connection. > > Actually it seems

Re: [sqlite] Getting last inserted rowid?

2009-06-05 Thread Nikolaus Rath
"Igor Tandetnik" writes: > Nikolaus Rath wrote: >> "Igor Tandetnik" writes: >>> Nikolaus Rath wrote: How can I determine the rowid of the last insert if I am accessing the db from different threads? If I understand correctly, last_insert_rowid() won't work reliably in this case. >

Re: [sqlite] Getting last inserted rowid?

2009-06-05 Thread John Machin
On 6/06/2009 8:19 AM, Nikolaus Rath wrote: > John Machin writes: >>> Now I'm confused. I want to know if it will be sufficient to wrap my >>> last_insert_rowid() call between BEGIN .. and END in order to make it >>> return the rowid that was last inserted by the same thread even if >>> multiple th

Re: [sqlite] Getting last inserted rowid?

2009-06-05 Thread Nikolaus Rath
John Machin writes: >> Now I'm confused. I want to know if it will be sufficient to wrap my >> last_insert_rowid() call between BEGIN .. and END in order to make it >> return the rowid that was last inserted by the same thread even if >> multiple threads are using the same connection (but differen

[sqlite] Caching model and aging timeout

2009-06-05 Thread Mike Borland
Hi! I have a few questions/observations about the caching model. Any help clarifying these issues would be greatly appreciated. (I'm working on a Windows Server class OS). 1) Setting the SQLITE_CONFIG_PAGECACHE keyword within sqlite3_config() seems to define a single cache for the instance of

Re: [sqlite] Search in multiple fields.

2009-06-05 Thread Jay A. Kreibich
On Fri, Jun 05, 2009 at 10:53:58AM -0400, German Escallon scratched on the wall: > Say I have the following record in my DB: > > Path: /home/media/mymusic > filename: rock_my_world > extension: mp3 > > I want to be able to find this file by typing any of the following in > the user interface tha

Re: [sqlite] Db design question (so. like a tree)

2009-06-05 Thread Francis GAYREL
I am not familiar with breeding business. My suggestion comes from a very different problem that i solved recently. The challenge was to describe a tree and to find the path to the root starting from any leaf or intermediate node. How to do? 1) The entity supported by the node shall support at l

Re: [sqlite] Search in multiple fields.

2009-06-05 Thread Alexandre Courbot
Hi, Not sure if that answers your question, but I think you seriously want to use FTS3. It will be both a trillion times faster than your current query - you may have trouble with your last example though. Maybe you can still go through by escaping the search terms. http://www.sqlite.org/cvstrac/

[sqlite] Search in multiple fields.

2009-06-05 Thread German Escallon
Hello all, I have a table with file information (path, filename, extension, size, etc), and I would like to enable search on this table based on different fields with a single input, and/or concatenation of the same. For example.. Say I have the following record in my DB: Path: /home/media/mymus

Re: [sqlite] "not an error" error inserting data trough a view on fts3 table

2009-06-05 Thread vkharitonov
I tried the scripts with the command line sqlite3 application. The row inserted in the data_view. But I received “SQL error: unknown error.” Pavel Ivanov-2 wrote: > > "Not an error" is SQLITE_OK. Are you sure that you don't do anything > between getting error code from SQLite and obtaining erro

Re: [sqlite] Db design question (so. like a tree)

2009-06-05 Thread Stephen Woodbridge
Here is a relational model that I use for my genealogy. It is in postgresql, but it should work fine in SQLite: All people are stored in the indi table: CREATE TABLE woodbridge.indi ( indi character varying(10) NOT NULL, lname character varying(30), fname character varying(60), title

Re: [sqlite] "not an error" error inserting data trough a view on fts3 table

2009-06-05 Thread Jay A. Kreibich
On Fri, Jun 05, 2009 at 11:50:02AM +0400, Vladimir Kharitonov scratched on the wall: > I have a problem inserting data through a view. > INSERT INTO data_view (id, created, content) > VALUES (randomblob(16), datetime('now'), 'data'); > > I receive strange SQLite Error: ???not an error???. > I us

Re: [sqlite] "not an error" error inserting data trough a view on fts3 table

2009-06-05 Thread Pavel Ivanov
"Not an error" is SQLITE_OK. Are you sure that you don't do anything between getting error code from SQLite and obtaining error message? Maybe in another thread? Pavel On Fri, Jun 5, 2009 at 3:50 AM, Vladimir Kharitonov wrote: > I have a problem inserting data through a view. > > This is my DB:

Re: [sqlite] foreign key problems

2009-06-05 Thread Igor Tandetnik
robinsmathew wrote: > hey i hve created a table > CREATE TABLE video_tab (video_id INTEGER, project_id INTEGER, > video_path VARCHAR(100), video_length INTEGER, video_type > VARCHAR(10), video_size VARCHAR(10), CONSTRAINT video_pk PRIMARY > KEY(video_id, project_id), CONSTRAINT fk_project_id FOREI

[sqlite] foreign key problems

2009-06-05 Thread robinsmathew
hey i hve created a table CREATE TABLE video_tab (video_id INTEGER, project_id INTEGER, video_path VARCHAR(100), video_length INTEGER, video_type VARCHAR(10), video_size VARCHAR(10), CONSTRAINT video_pk PRIMARY KEY(video_id, project_id), CONSTRAINT fk_project_id FOREIGN KEY (project_id) REFERENC

Re: [sqlite] Db design question (so. like a tree)

2009-06-05 Thread John Machin
On 5/06/2009 5:27 PM, Francis GAYREL wrote: > To build a consistent oriented tree we need to associate to the nodes a > ranking property such as the birthdate (or any precedence criterion). > Therefore the ancestor of someone is to be selected among older ones. "Ancestor" is a *derived* relati

Re: [sqlite] Why row is not found?

2009-06-05 Thread Marco Bambini
Hello Martin, it's a db than an user sent me... so I really don't know... -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ On Jun 5, 2009, at 11:31 AM, Martin Engelschalk wrote: > Hi Marco, > > How do you insert this data into your database? > I opened your databas

Re: [sqlite] Why row is not found?

2009-06-05 Thread Martin Engelschalk
Hi Marco, How do you insert this data into your database? I opened your database with an old version of SQLiteSpy, which uses an even older version of sqlite. It showed the value as a blob. Martin Marco Bambini wrote: > I understand that the issue could be caused by the wrong datatype... > but

Re: [sqlite] Why row is not found?

2009-06-05 Thread Marco Bambini
I understand that the issue could be caused by the wrong datatype... but what is strange is that the same db and the same query worked fine with sqlite 3.4.2 and the behavior changed with sqlite 3.6.x -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ On Jun 5, 200

Re: [sqlite] Why row is not found?

2009-06-05 Thread Martin Engelschalk
Your field value is a blob, so you have to use a cast like you did to find the row, or use a blob literal: SELECT * FROM lo_user WHERE lo_name=X'61646d696e'; Marco Bambini wrote: > I just posted the db on my website... there is one row and there > aren't invisible characters. > > Please note

Re: [sqlite] Why row is not found?

2009-06-05 Thread bartsmissaert
Maybe don't use varchar, but text instead when creating the table. RBS > I just posted the db on my website... there is one row and there > aren't invisible characters. > > Please note that the following query returns the exact row: > SELECT * FROM lo_user WHERE CAST(lo_name AS TEXT)='admin'; >

Re: [sqlite] Why row is not found?

2009-06-05 Thread Marco Bambini
I just posted the db on my website... there is one row and there aren't invisible characters. Please note that the following query returns the exact row: SELECT * FROM lo_user WHERE CAST(lo_name AS TEXT)='admin'; but I really don't have an explanation... -- Marco Bambini http://www.sqlabs.com h

Re: [sqlite] Why row is not found?

2009-06-05 Thread Martin Engelschalk
Hi, attachments do not make it through the list. There is no row with the value 'admin' in the field 'lo_name' in your table. Did you check that there are no blank spaces or other invisible characters? Martin Marco Bambini wrote: > Anyone can please explain me why this query: > SELECT * FROM l

Re: [sqlite] Why row is not found?

2009-06-05 Thread Marco Bambini
You can download the db from: http://www.sqlabs.com/download/test.sqlite It's only 4KB. -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ On Jun 5, 2009, at 11:04 AM, Marco Bambini wrote: > Anyone can please explain me why this query: > SELECT * FROM lo_user WHERE lo

[sqlite] Why row is not found?

2009-06-05 Thread Marco Bambini
Anyone can please explain me why this query: SELECT * FROM lo_user WHERE lo_name='admin'; returns 0 rows in this db? Thanks. -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ ___ sqlite-users mailing list sqlite-users@sq

Re: [sqlite] how to compose the sql sentence?

2009-06-05 Thread liubin liu
Thank you very much! you told me how to do. but I missed the "... defined as UNIQUE ...". Actually my question is just solved by two step: First - CREATE UNIQUE INDEX i_recdata ON rec_data (num, di, time1); Second - INSERT OR REPLACE INTO rec_data (num, di, data, time1, time2, format) VALUES

[sqlite] "not an error" error inserting data trough a view on fts3 table

2009-06-05 Thread Vladimir Kharitonov
I have a problem inserting data through a view. This is my DB: CREATE TABLE data ( id BLOB PRIMARY KEY, created REAL NOT NULL ); CREATE VIRTUAL TABLE text USING FTS3(); CREATE VIEW data_view AS SELECT d.id, d.rowid, d.created, t.content FROM data d INNER JOIN text t ON d.row

Re: [sqlite] Db design question (so. like a tree)

2009-06-05 Thread Francis GAYREL
To build a consistent oriented tree we need to associate to the nodes a ranking property such as the birthdate (or any precedence criterion). Therefore the ancestor of someone is to be selected among older ones. To make the ancestor allocation more easy the ancestor's list may be filtered on