Re: [sqlite] In memory database and locking.

2010-09-08 Thread Drake Wilson
Quoth Hemant Shah , on 2010-09-08 20:55:29 -0700: > Both of these processes are sibling and have same database > handle. No, don't do that. http://www.sqlite.org/faq.html#q6 And :memory: databases are not shared between processes, AFAIK. Why are there two processes anyway?

Re: [sqlite] In memory database and locking.

2010-09-08 Thread Hemant Shah
vacuum is a no-op for in memory database. Hemant Shah E-mail: hj...@yahoo.com --- On Wed, 9/8/10, Woody & Yuni Ho wrote: From: Woody & Yuni Ho Subject: Re: [sqlite] In memory database and locking. To: "General Discussion of SQLite Database"

Re: [sqlite] In memory database and locking.

2010-09-08 Thread Woody & Yuni Ho
Have you tried issueing a vacum after n deletes? Woody wizard at large(I'm in shape. Round is a shape) Connected by MOTOBLUR™ on T-Mobile -Original message- From: Hemant Shah To: General Discussion of SQLite Database Sent: Wed, Sep 8, 2010

Re: [sqlite] In memory database and locking.

2010-09-08 Thread Hemant Shah
I forgot to mention, that I have set pragma journal_mode to off and for every insert I doprepare -> step -> finalize -> COMMIT. Hemant Shah E-mail: hj...@yahoo.com --- On Wed, 9/8/10, Hemant Shah wrote: From: Hemant Shah Subject: [sqlite] In memory database

[sqlite] In memory database and locking.

2010-09-08 Thread Hemant Shah
Folks, I am trying to write an application that reads packets from the network and inserts it into sqlite database, I have a unique key which is combination of couple of columns. I want to find re-transmitted packets so I rely on the fact that if I violate unique key constraint then I have

Re: [sqlite] Are triggers the best way to store the modification time?

2010-09-08 Thread Oliver Schneider
On 2010-09-09 00:15, Igor Tandetnik wrote: > This updates all the rows in the table, not just the one for which the > trigger was fired. You want something along the lines of > > UPDATE file SET modified=julianday('now') > where file.rowid = new.rowid; Ouch. Thanks for shedding some light on

[sqlite] Kevin Smekens - out of the office.

2010-09-08 Thread Kevin Smekens
I will be out of the office starting 2010/09/09 and will not return until 2010/09/16. Thank you for your message. During my absence, you can contact my direct colleague Nicolas Bonte at following mail: nicolas.bo...@awtce.be Best ___ sqlite-users

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Igor Tandetnik
Simon Slavin wrote: > I was attempting to find a value which would always coerce directly to the > affinity of the column, so when you read it back out > it would always be the 'proper' type. My theory would be that this one value > could be used to betray the affinity of

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Simon Slavin
On 9 Sep 2010, at 1:13am, Igor Tandetnik wrote: > Simon Slavin wrote: >> What would happen if you wrote a row with '1.1' for every value, then used >> sqlite3_column_type when you read it back out ? >> Assuming that it was possible (i.e. no TRIGGER or UNIQUE prevented

Re: [sqlite] Are triggers the best way to store the modification time?

2010-09-08 Thread Igor Tandetnik
Oliver Schneider wrote: > Hmm, strange. These are the triggers I used: > > CREATE TRIGGER IF NOT EXISTS file_change AFTER UPDATE OF hash,name,path > ON file > BEGIN >UPDATE file SET modified=julianday('now'); > END; This updates all the rows in the table, not just the

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Igor Tandetnik
Simon Slavin wrote: > On 9 Sep 2010, at 12:01am, Igor Tandetnik wrote: > >> sqlite3_column_type returns the type of the value in the given column and >> the current row. The type reported by >> sqlite3_column_type may change from row to row. It is largely unrelated to >>

Re: [sqlite] Are triggers the best way to store the modification time?

2010-09-08 Thread Oliver Schneider
Thanks for your reply. > Can't you just include the modified value within your UPDATE or > INSERT statement? Or is the modified column in a separate table? Guess I'll do that. SQLite is just so convenient even from command line, that I thought it'd be better to automate that part to figure out

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Simon Slavin
On 9 Sep 2010, at 12:01am, Igor Tandetnik wrote: > sqlite3_column_type returns the type of the value in the given column and the > current row. The type reported by sqlite3_column_type may change from row to > row. It is largely unrelated to the type "you originally intended the column > to

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Nicolas Williams
On Wed, Sep 08, 2010 at 07:01:19PM -0400, Igor Tandetnik wrote: > Schrum, Allan wrote: > > I guess I'm confused as to why sqlite3_column_type() would not work? It > > works for me on queries and I get back either > > SQLITE_INTEGER, SQLITE_FLOAT, or SQLITE3_TEXT. While

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Igor Tandetnik
Schrum, Allan wrote: > I guess I'm confused as to why sqlite3_column_type() would not work? It works > for me on queries and I get back either > SQLITE_INTEGER, SQLITE_FLOAT, or SQLITE3_TEXT. While I know the types could > be coerced to something else, at least it is

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Richard Hipp
On Wed, Sep 8, 2010 at 5:01 PM, Andrew Wood wrote: > Because I'm writing glue code between the SQLite API and a higher level > library which provides a standard API across several DBMSs. > > In other DBMSs even if a field contains null you can still ask the API > what type it

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Simon Slavin
On 8 Sep 2010, at 10:36pm, Jay A. Kreibich wrote: > I also have to say that handling NULLs as a value-less type is a very > clean and handy model. Today at work I had to thoroughly investigate a program I wrote long ago and look for places where NULL, undefined, -1 and 'false' might appear

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Schrum, Allan
I guess I'm confused as to why sqlite3_column_type() would not work? It works for me on queries and I get back either SQLITE_INTEGER, SQLITE_FLOAT, or SQLITE3_TEXT. While I know the types could be coerced to something else, at least it is an answer of what you originally intended the column to

[sqlite] sqlite3_bind_*() routines does no t work in this case.

2010-09-08 Thread Zhixiang Zhu
> Trigger is a plain text remembered and executed at certain points of > time. If you know your maximum number of employees at the time when > you create trigger then just put it there instead of question mark. If > you wanted to change that maximum at each trigger execution then it > won't work

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Jay A. Kreibich
On Wed, Sep 08, 2010 at 10:01:48PM +0100, Andrew Wood scratched on the wall: > Because I'm writing glue code between the SQLite API and a higher level > library which provides a standard API across several DBMSs. > > In other DBMSs even if a field contains null you can still ask the API >

Re: [sqlite] Detecting storage class from C

2010-09-08 Thread Andrew Wood
Because I'm writing glue code between the SQLite API and a higher level library which provides a standard API across several DBMSs. In other DBMSs even if a field contains null you can still ask the API what type it 'should' have been if something *had* been put in it. Without this ability,

Re: [sqlite] sqlite3_bind_*() routines does not work in this case.

2010-09-08 Thread Pavel Ivanov
> I intended to use sqlite3_bind_int() to bind the maximal number of employees > a department can contain to the template. The C program works without error. > However, the trigger does not work when I insert into the employees table. > I used the latest sqlite-3.7.2. Is this a bug of SQLite? Or

[sqlite] sqlite3_bind_*() routines does no t work in this case.

2010-09-08 Thread Zhixiang Zhu
Hi everyone, My C program has a CREATE TRIGGER statement which contains a template "?": CREATE TABLE employees ( employee_id INTEGER PRIMARY KEY, dep_id TINYINT, score FLOAT ); CREATE TRIGGER on_ins_employee AFTER INSERT ON employees WHEN ? < (SELECT count(1) FROM employees WHERE dep_id

Re: [sqlite] Increment counter or insert row in one statement

2010-09-08 Thread Zack Weinberg
Igor Tandetnik wrote: > Zack Weinberg wrote: [...] >> Is it possible to do this operation in one SQLite statement? > > insert or replace into observations > values (:src, :dest, :verb, > coalesce( >(select occurrences from observations > where src=:src and dest=:dest

Re: [sqlite] Increment counter or insert row in one statement

2010-09-08 Thread Zack Weinberg
On Tue, Sep 7, 2010 at 4:45 AM, Simon Slavin wrote: > On 7 Sep 2010, at 4:34am, Zack Weinberg wrote: > >> I'm not subscribed to the mailing list, please cc: me on replies. > > No.  If you don't read a mailing list, don't post to it. I have one question. You should not

Re: [sqlite] WinCE possible bug

2010-09-08 Thread Israel Lins Albuquerque
Thanks, "Zaher Dirkey"! Only, PRAGMA journal_mode = TRUNCATE solves my problem. By some way the O.S. is locking the one off the journals and the program can't delete it. -- Atenciosamente/Regards, Israel Lins Albuquerque Desenvolvimento/Development Polibrás Brasil Software Ltda.

Re: [sqlite] WinCE possible bug

2010-09-08 Thread Israel Lins Albuquerque
No. I use sqlite in proprietary application, not the shell! I use cegcc to compile sqlite. - "ydlu" escreveu: > Hi: > Could you give me some info how you use SQLite in WinCE 6.0? Do you convert > the shell program to WinCE? I mean run "Sqlite3.exe" in WinCE. > If

Re: [sqlite] Mozilla History Autodelete

2010-09-08 Thread All Marri
Hi , I am SORRY for my delay to reply . damned vacations . Yes . is the limit , indeed often It deletes the newer one and not the last or random deleting . I have often an allmost full HD . Is it a cause ? However this I would to ask if is possible to regain the history / bookmarks

Re: [sqlite] WinCE possible bug

2010-09-08 Thread ydlu
Hi: Could you give me some info how you use SQLite in WinCE 6.0? Do you convert the shell program to WinCE? I mean run "Sqlite3.exe" in WinCE. If you run x86 platform, could you share some idea with the WinCE developer? Thanks Lu On Fri, Sep 3, 2010 at 5:40 AM, Israel Lins Albuquerque <

Re: [sqlite] Are triggers the best way to store the modification time?

2010-09-08 Thread Nick Shaw
Oliver Schneider wrote: > I'm having a table of file names along with hashes and so on. In order > to make sure that we keep a record, I had put a trigger on UPDATE and > INSERT which would set the column 'modified' (REAL, Julian day) to the > time of the change. However, this slows down any

Re: [sqlite] Tcl bindings are a little problematic.

2010-09-08 Thread Paweł Salawa
Hi, I have a feeling that thread "Tcl bindings are a little problematic." is forgotten, but yet not concluded. I want to catch your eye again on it. Please see response below. Regards, Pawel From: Paweł Salawa Subject: Re: Tcl bindings are a little problematic. Newsgroups: