Re: [sqlite] using sqlite for searching

2009-02-13 Thread Kees Nuyt
be good enough. Will you use FTS? http://www.sqlite.org/cvstrac/wiki?p=FtsTwo >Can any one help me with this. It would be really helpful to me. >Thank You in Advance -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] open/close db's across threads

2009-02-13 Thread Kees Nuyt
) and sqlite3_finalize()? Do you check the return code of sqlite3_close() ? -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Full Table Read

2009-02-13 Thread Kees Nuyt
is is slow, just curious. The speed very much depends on what you do with the output. If it scrolls over a terminal, the terminal will be the bottleneck. It should be very fast if you redirect the output to /dev/null. -- ( Kees Nuyt ) c[_] ___ sqlite-users m

Re: [sqlite] SQLite- Memory heap usage query

2009-02-17 Thread Kees Nuyt
ma - Do not define indexes that are seldomly used - Try to use integers as primary key, make it the first column, and use the exact code CREATE TABLE tablename ( columnname INTEGER PRIMARY KEY, ); - Do not store data that you don't need >Thanks in ad

Re: [sqlite] SQLite- Memory heap usage query

2009-02-17 Thread Kees Nuyt
On Tue, 17 Feb 2009 19:11:56 +0100, Kees Nuyt <k.n...@zonnet.nl> wrote in sqlite-users@sqlite.org: I'm not fond of replying to myself, but this needs some clarification: >- Try to use integers as primary key, > make it the first column, << wrong > and use the exact

Re: [sqlite] Newb-ish performance questions

2009-02-22 Thread Kees Nuyt
make it too big. 4096 or 8192 are a good start to experiment with. > Unless anyone has some good ideas I might > have to give up on Sqlite. I'm sure you can get more performance if you tweak page_size and cache_size with some more understanding. Use whatever engine is best for the tas

Re: [sqlite] running sqlite with gcc C

2009-02-25 Thread Kees Nuyt
l http://www.sqlite.org/cvstrac/wiki >Thank you very much > >Michael R HTH -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] running sqlite with gcc C

2009-02-25 Thread Kees Nuyt
g more time on the site ;) -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] manual with sample C programs

2009-02-26 Thread Kees Nuyt
>Thanks very much > >Michael R -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question

2009-02-26 Thread Kees Nuyt
I don't advise this, it's hard to maintain. A loadable extension is the "proper mechanism". >-Bryan -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] view and attach database problem

2009-02-27 Thread Kees Nuyt
On Sat, 28 Feb 2009 00:20:48 +0300, Alexey Pechnikov <pechni...@mobigroup.ru> wrote: >Hello! > >On Friday 27 February 2009 21:50:30 Kees Nuyt wrote: >> A view or trigger in one database is not allowed to >> reference tables (or other views) in other databases. T

Re: [sqlite] DateTime Objects

2009-02-28 Thread Kees Nuyt
cation do the formatting. SQL isn't meant for presentation anyway, it's for relational storage. Example: Compute the time since the unix epoch in seconds (like strftime('%s','now') except this includes the fractional part): SELECT (julianday('now') - 2440587.5)*8640

Re: [sqlite] DateTime Objects

2009-03-01 Thread Kees Nuyt
e functions to return any of a few supported formats your application can cope with. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Joins

2009-03-02 Thread Kees Nuyt
oogle.com/search?hl=en=SQL+join+"cheat+sheet"+sqlite >Michael > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- ( Kees Nuyt ) c[_] _

Re: [sqlite] Double entry bookkeeping

2009-03-05 Thread Kees Nuyt
iety of clients and >developers. Here are the top group of items I think you have missed: [snip] Excellent article! -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] which func could get the number of rows

2009-03-06 Thread Kees Nuyt
s. http://www.sqlite.org/lang_transaction.html I hope this helps and I added it to the wiki FAQ: http://www.sqlite.org/cvstrac/wiki?p=SqliteWikiFaq -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bi

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-06 Thread Kees Nuyt
t.c > >If somebody found it useful or good enough: Feel free to use it, change it, >or put on wiki pages. I added it to the Wiki : http://www.sqlite.org/cvstrac/wiki?p=SampleCode -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-u

Re: [sqlite] which func could get the number of rows

2009-03-07 Thread Kees Nuyt
h >kind of codes when using "sqlite3_prepare_v2() + sqlite3_step() + >sqlite3_column_*()"? Perhaps the sqlite3_get_table() API is what you are looking for? http://www.sqlite.org/c3ref/free_table.html > >Kees Nuyt wrote: >> >> On Fri, 6 Mar 2009 02:15:10 -0800 (PST

Re: [sqlite] is there any way to attach more than 10 databases ?

2009-03-07 Thread Kees Nuyt
to attach > at least 30 db at once ? It's in the documentation: http://www.sqlite.org/lang_attach.html >thanx! > >bax -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how to do fulltest with amalgamation source

2009-03-09 Thread Kees Nuyt
ww.sqlite.org/cvstrac/wiki?p=SqliteWikiFaq >If not, >are there any plans to add a "check" or "test" or "fulltest" target to >the amalgamation source? > >Thanks, > >Tim -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-11 Thread Kees Nuyt
OIN db2.TableTwo n ON n.MyID=d.MyID WHERE d.Zip > 80000 ORDER BY d.Zip; DETACH DATABASE db2; -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] writting a text file from sqlite db in C

2009-03-12 Thread Kees Nuyt
mpleCode >Thank you very much > >Michael -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-12 Thread Kees Nuyt
) VALUES (2,""); .quit sqlite3 database1.sdb attach database 'database2.sdb' as db2 select . {{results}} .quit Hope this helps. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite Database Corruption

2009-03-13 Thread Kees Nuyt
http://www.sqlite.org/lockingv3.html#how_to_corrupt http://www.sqlite.org/cvstrac/wiki?p=DatabaseCorruption http://www.sqlite.org/atomiccommit.html >Thanks and regards > >Chaitali -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite

Re: [sqlite] Upgrade from 3.5.9 to 3.6.11

2009-03-13 Thread Kees Nuyt
3.6.11. > Thank in advance, > JP -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Query Doesn't Find Record

2009-03-13 Thread Kees Nuyt
his for the Windows platform. sqlite3.exe in a CMD window. If I suspect the SQL is difficult enough to make typoos, I write a script with an ascii editor. sqlite3 test.db3 Thanks. > >Jonathan -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sq

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-14 Thread Kees Nuyt
y Shower|Carrot Cake 9|2|The Jacket| 10|2|The Chinese Restaurant| 11|2|The Phone Message| 12|2|The Apartment| 13|2|The Stranded|Cinnamon Bobka 14|2|The Statue| # -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite

Re: [sqlite] IP from number with SQL

2009-03-15 Thread Kees Nuyt
'|| > CAST((intIP & 65280) >> 8 AS text)||'.'|| > CAST((intIP & 255) AS text) AS strIP > FROM IP_table; Cute code, thanks. The implementation of BitAnd and ShiftRight in the SQLite VM (~line 10176 in the amalgamated sqlite.c) is very straightforward and should be pretty fast. &g

Re: [sqlite] Newbie question

2009-03-18 Thread Kees Nuyt
in mind all the comments about single quotes. > >A bit more information though. Is there a term for >that type of SELECT statement? See above. >Thanx, >Dp. HTH -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Schema syntax error

2009-03-19 Thread Kees Nuyt
; Which when enabled allows you to UPDATE or DELETE against the sqlite_master table. == Using this PRAGMA, you can UPDATE the sql column in the sqlite_master table. Of course this is undocumented and unsupported, and you risk corru

Re: [sqlite] is primary key already indexed ?

2009-03-19 Thread Kees Nuyt
mary key on a text column) that won't make a difference, I think. >thank you -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Any available free SQLite Database Comparer/Diff Tool?

2009-03-19 Thread Kees Nuyt
ite3 test_41.db3 .dump >t41 # diff t38 t41 >Thanks, >Ev -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] is primary key already indexed ?

2009-03-19 Thread Kees Nuyt
synchronous=off (only during loading) By the way, INTEGER PRIMARY KEY is faster than a TEXT column (VARCHAR is also TEXT) as primary key. >thnx -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] memory and db size

2009-03-19 Thread Kees Nuyt
nfo on http://www.sqlite.org/ about architecture and optimization. > 3. Are there any ways to compress db files in disk (for > free) and then is sqlite able to still get to the data > easily? Donald already gave a good answer to that question. > Thank you! -- ( Kees Nuyt ) c[_]

Re: [sqlite] writting a text file from sqlite db in C

2009-03-21 Thread Kees Nuyt
gt;> Apart from the sqlite command line tool, I can recommend >> the source of fossil, which does all its magic around a >> SQLite database: >> http://www.fossil-scm.org/index.html/doc/tip/www/index.wiki >> >> Also, there is some code in the SQLite wiki: >> http://www

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-21 Thread Kees Nuyt
size I would start with the maximum page_size allowed, that is 32768 bytes. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-21 Thread Kees Nuyt
SD) I have no idea what else can be done to improve performance. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-21 Thread Kees Nuyt
6.11 and 3.6.12 (e.g. checkin 6341 http://www.sqlite.org/cvstrac/chngview?cn=6341 ). The effect would be that often used pages (like non-leaf index pages) are retained, which could reduce I/O. >Also, you might consider going 64-bit. -- ( Kees Nuyt ) c[_]

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-21 Thread Kees Nuyt
m for OS diskbuffers. > I will try out with PostGres and report back on what I get. I'm curious. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Step Query

2009-03-25 Thread Kees Nuyt
/cvstrac/wiki?p=SampleCode we already have. I feel tempted to put it in the wiki http://www.sqlite.org/cvstrac/wiki under the 'Hints For Using SQLite More Effectively' heading, as http://www.sqlite.org/cvstrac/wiki?p=SimpleCode. Would you mind if I do? -- ( Kees Nuyt ) c[_] ___

Re: [sqlite] Strict affinity again

2009-03-25 Thread Kees Nuyt
; > > > > >___ > >sqlite-users mailing list > >sqlite-users@sqlite.org > >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >___

Re: [sqlite] Insert performance in 3.6.11 vs. 3.5.5

2009-03-25 Thread Kees Nuyt
d everyone who contributed to this great peace of >software. +1 >Thanks and best regards, > >Günter -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Step Query

2009-03-26 Thread Kees Nuyt
On Wed, 25 Mar 2009 18:47:14 -0600, Dennis Cote <r.dennis.c...@gmail.com> wrote: >Kees Nuyt wrote: >> >> This seems a very nice addition to the >> http://www.sqlite.org/cvstrac/wiki?p=SampleCode >> we already have. >> >> I feel tempted to put it in th

Re: [sqlite] Help with SQL and index (or schema?)

2009-03-27 Thread Kees Nuyt
e absolute path), but I guess you are aware of that :) >Can someone help me? > >Regards, >Jonas -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Help with SQL and index (or schema?)

2009-03-27 Thread Kees Nuyt
On Fri, 27 Mar 2009 18:08:13 +0100, Kees Nuyt <k.n...@zonnet.nl> wrote: > PRIMARY KEY (filepathid,filename,istarget) Oops, make that PRIMARY KEY (pathid,filename,istarget) -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sql

Re: [sqlite] sequential row numbers from query

2009-03-27 Thread Kees Nuyt
lve it in the host language, which is what I would do. Actually, OP's original: sqlite3 db 'select * from foo order by field desc; '|cat -n is pretty good. Oh, well, there are 11 roads to Rome :) -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing

Re: [sqlite] Newbie what does & do.

2009-03-28 Thread Kees Nuyt
syntax 6MATCH reserved for user C function match() 6REGEXP reserved for user C function regexp() 7ANDboolean (logical) AND 8OR boolean (logical) OR (Note to the SQLite developers: I could put this in the wiki but it might be better to update the http://www.sqlite.org/lang_expr.html#binaryops page itself) > Again sorry for the post. No problem. >Dp. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] creating unique data takes many hours, help

2009-03-29 Thread Kees Nuyt
t; >sqlite3_exec(db, zSQL, 0, 0, 0); >sqlite3_free(zSQL); Two common optimizations: 1) Wrap the INSERT statements in a transaction while not EOF on input file BEGIN loop 1 times or EOF

Re: [sqlite] Insert performance in 3.6.11 vs. 3.5.5

2009-04-01 Thread Kees Nuyt
ed this, as now even the >original system no longer shows this effect, but it's very probably >not SQLite. > >Best regards, > >Günter Ok, I'm glad it works for you. Thanks for letting us know. -- ( Kees Nuyt ) c[_] ___ sqlit

Re: [sqlite] Library Linking Issues on Ubuntu

2009-04-02 Thread Kees Nuyt
a while, but if it's your personal system it won't hurt anybody. >Thanks! -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite performance on select/update with 11GB database file

2009-04-09 Thread Kees Nuyt
e they getting slower the >further I go? And why are the updates so slow? > >Is it because the database file is too big? > >Any help or suggestions would be highly appreciated! > >Regards, > >Flo -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Heuristics of when to vacuum

2009-04-12 Thread Kees Nuyt
esn't tell anything about the average percentage of payload in database pages, which would be another reason to vacuum. For a full analysis, you'd have to run the sqlite3_analyzer program, or incorporate part of its code in your application. -- ( Kees Nuyt ) c[_] ___

Re: [sqlite] fail to drop table in transaction

2009-04-13 Thread Kees Nuyt
Does the same SQL work correctly from the command line tool? It is not very common to drop a table when data changes, usually the schema is stable and rows are inserted into and deleted from tables, or column values changed. It might indicate a flaw in your

Re: [sqlite] fail to drop table in transaction

2009-04-13 Thread Kees Nuyt
For a normal application, you wouldn't have to drop tableB, but just insert / delete rows. What are you trying to accomplish? -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Mismatched columns in union can repeatably crash 2.6.10

2009-04-15 Thread Kees Nuyt
ng else, start with: http://www.sqlite.org/sitemap.html >Cheers, -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Tree structure in SQLite DB

2009-04-20 Thread Kees Nuyt
this DB? Roger Binns is right. Just another hint: Search for "adjacency model" and "nested set", which are the two most common models. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] retrieval of blobs stored in sqlite

2009-04-21 Thread Kees Nuyt
the optimum for your environment and application. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite syntax railroad diagrams

2009-04-21 Thread Kees Nuyt
@hwaci.com> Date: Mon, 20 Apr 2009 06:53:37 -0400 : http://wiki.tcl.tk/21708 >They're very nice :) > >Cheers, >Andrey -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] create the trigger to delete the data from other database

2009-04-22 Thread Kees Nuyt
cross Attached Databases (2008-01-24 11:56:16 UTC). Cheers, -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to exit from sqlite shell?

2009-05-04 Thread Kees Nuyt
ix systems > - I don't know if Control-D works on windows) Control-D doesn't work in sqlite3.exe on windows, Control-C does, both in the windows shell (CMD.EXE) and in msys (mingw32) bash. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to exit from sqlite shell?

2009-05-04 Thread Kees Nuyt
or. On Unix the Control-D by itself is enough. >Pavel -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to check the healthy of database and the indexes of the tables

2009-05-05 Thread Kees Nuyt
;out that "database disk image is malformed". > Is there any command to check if the index >or database in good condition. PRAGMA integrity_check; http://www.sqlite.org/pragma.html#debug >Thanks, >JP -- ( Kees Nuyt ) c[_] ___ sql

Re: [sqlite] SQL error: database disk image is malformed

2009-05-05 Thread Kees Nuyt
re right, it doesn't make sense. @Joannek: When using group by, your select columns can only use aggregate functions and the columns you group by. Perhaps you meant to use ORDER BY here ? >Pavel -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing

Re: [sqlite] SQL error: database disk image is malformed

2009-05-06 Thread Kees Nuyt
On Wed, 6 May 2009 00:40:22 -0500, "Jay A. Kreibich" <j...@kreibi.ch> wrote: >On Tue, May 05, 2009 at 11:46:38PM +0200, Kees Nuyt scratched on the wall: >> On Tue, 5 May 2009 16:55:42 -0400, Pavel Ivanov >> <paiva...@gmail.com> wrote: >> >>

Re: [sqlite] sqlite3 source code modification

2009-05-06 Thread Kees Nuyt
's never printed anything. I even reinstalled my os system. >I am pretty much confused with it. Could anyone give me some advice, please? In your shell, type: which sqlite3 Does the result point to the result of yur compilation of sqlite3 ? >Thanks so much. -- ( Kees Nuyt ) c[_] ___

Re: [sqlite] Increasing output

2009-05-06 Thread Kees Nuyt
m not sure what you mean here. Guessing: To sort by the third column of your result set, use: SELECT * FROM mytable ORDER BY name_of_third_column; or SELECT * FROM mytable ORDER BY 3; >Thanks in advance. -- ( Kees Nuyt ) c[_] ___ sqlite-users

Re: [sqlite] sqlite in shell loop

2009-05-06 Thread Kees Nuyt
put to stdout, so it works like any other unix utility. Just give it a go. Experiment. And enjoy. >Thanks in advance -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sqlite3 tables hidden from program to program

2009-05-06 Thread Kees Nuyt
arameter on the sqlite command line? As in: # sqlite3 my.db See also: http://www.sqlite.org/quickstart.html If you leave out the databasefilename, sqlite uses an in-memory database, which is destroyed as soon as you leave/quit/exit the command li

Re: [sqlite] sqlite in shell loop

2009-05-06 Thread Kees Nuyt
On Wed, 6 May 2009 23:24:00 +0200, Daniel Wolny <dan...@szelka.net> wrote: >2009/5/6 Kees Nuyt <k.n...@zonnet.nl>: >> On Wed, 6 May 2009 23:01:24 +0200, Daniel Wolny >> <dan...@szelka.net> wrote: >> It should be possible, sqlite sends its output to std

Re: [sqlite] Newbie trying to list resultSet with C

2009-05-08 Thread Kees Nuyt
an SQLite database. Very basic but fully functional nevertheless. http://www.sqlite.org/cvstrac/wiki?p=SampleCode Example C code for creating / writing to / reading from a database. >TIA, >Nuno Magalhães -- ( Kees Nuyt ) c[_] ___ sqlite-use

Re: [sqlite] Multiple counts between two tables

2009-05-10 Thread Kees Nuyt
FROM tag_link INNER JOIN app_name ON (app_name.id = tag_link.app_id) GROUP BY tag_link.app_id; app_name.id|app_name.app|nrtags 30|a|1 39|b|1 49|t|2 331|d|3 >The parser returns no error, only seems to freeze. Tipps, hints – all kind >of advice. >sincerely, ckeen Hope this helps. -- (

Re: [sqlite] Multiple counts between two tables

2009-05-10 Thread Kees Nuyt
, is that the same application ('d') uses the same tag more then once. Is that on purpose? In other words, it's not completely clear to me what you are trying to accomplish. >Regards, >-steffen > > >Kees Nuyt wrote: >> >> On Sun, 10 May 2009 13:51:29 -0700 (PDT), ck

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Kees Nuyt
par = $this->prepare($sql); if (is_array($parlist)){ /* we got a text array with params */ foreach ($parlist as $aval){ $stpar->execute(array(':jobid' => $jobid, ':partx' => $aval)); } } else if (is_object($parlist)) { /* we got a resultset from a query as paramlist */ while ($row = $parlist->fetch(PDO::FETCH_NUM)){ $stpar->execute(array(':jobid' => $jobid, ':partx' => $row[0])); } } } else { } $this->commit(); /* * ugly code to launch the dispatcher asynchronously using * Windows schtasks.exe is left to the imagination of the reader */ } -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sqlite as a FIFO buffer? (How make atomic?)

2009-05-18 Thread Kees Nuyt
gt;Table: task_status_log => (id, fk_task_log, status_code, time_stamp) > >And in psudo SQL: > >TRIGGER ON INSERT INTO task_log: >BEGIN >INSERT INTO task_fifo (fk_task_log) VALUES (NEW.id) >END; > >TRIGGER ON DELETE FROM task_fifo: >BEGIN >

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Kees Nuyt
QLite sort the resultset before it can return the first row in the resultset. Need I say more? http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/

Re: [sqlite] Simple Outer Join question?

2009-05-25 Thread Kees Nuyt
s simple, but not for me. This is an n:m relationship. If group has more attributes (columns) than just its number, you need a third table: person_group. Then join person with person_group where group_id != 1; The person_group table could be called membership, if you like. >Thanks in advance &g

Re: [sqlite] create indexed view

2009-05-26 Thread Kees Nuyt
On Tue, 26 May 2009 14:44:25 +0800, wying wy <joyousl...@gmail.com> wrote: >Hi > >May I know if we can create index on a View? You can't create an index on a VIEW. A VIEW can be seen as a stored SELECT statement. >Thanks in advance. >wying --

Re: [sqlite] Deleting database content : SQLite3 API

2009-05-30 Thread Kees Nuyt
p, I cannot just drop the >> tables. ( As the table which are present in the existing data base is >> not known. ) >> >> I am using sqlite3wrapped C++ library APIs. >> >> Thanks and Regards, >> Souvik -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] (no subject)

2009-06-01 Thread Kees Nuyt
ine on simulator. > >Can anyone provide any input on this? ASCII versus UTF-8 or UTF-16? -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question on Indexing

2009-06-01 Thread Kees Nuyt
table, so you should make (a_id,b_id) the primary key to enforce that constraint. >Thanks >Ralf -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Should we upgrade the SQLite to 6.6.14.2 from 3.59

2009-06-01 Thread Kees Nuyt
erested in what happened to sqlite, a weekly peek at http://www.sqlite.org/cvstrac/timeline is worth the effort. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how can we solve IF EXIST in SQLite

2009-06-02 Thread Kees Nuyt
; UPDATE stock_tab SET . WHERE stock_id = 1; if sqlite_error() INSERT INTO stock_tab SET (...) VALUES (...); endif COMMIT; -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Kees Nuyt
in every INSERT statement, which has implications for your program flow. http://www.sqlite.org/lang_insert.html http://www.sqlite.org/lang_conflict.html (You probably already read those pages, I included the links for the convenience of other readers) >Luiz -- ( Kees Nuyt ) c[_] _

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Kees Nuyt
error message will be cleared. You can use INSERT ON CONFLICT ABORT ... ; Catch the constraint error, fetch the sqlite3_errmsg() and ROLLBACK yourself. http://www.sqlite.org/lang_conflict.html (untested) >Thanks in advance. > >Luiz -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Before Update trigger question

2009-06-02 Thread Kees Nuyt
( (SELECT device_id FROM registrations WHERE mesg_token = 'aa') , 1, 2, 2); SQL error near line 38: 1001: Insert -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite programmed in C++

2009-06-02 Thread Kees Nuyt
dized). For ease of use on platforms with a decent C++ compiler, there are good C++ wrappers. So, there is a choice for application development. >I just read the Linus Torvalds comment on the C++ for Git >What do you think? > >Cheers, >Sylvain -- ( Kees Nuyt ) c[_] ___

Re: [sqlite] Before Update trigger question

2009-06-02 Thread Kees Nuyt
d why it works. >Thanks a lot, You're welcome, have fun. >-B -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how can we solve IF EXIST in SQLite

2009-06-03 Thread Kees Nuyt
; > > >its showing an error near "if": syntax error > > >Kees Nuyt wrote: >> >> On Tue, 2 Jun 2009 03:36:46 -0700 (PDT), robinsmathew >> <robinsmat...@hotmail.com> wrote: >> >>> >>>hey thanx for the reply... u leave the th

Re: [sqlite] [OT-ish] ResultSet size

2009-06-07 Thread Kees Nuyt
small results sets ... keep in mind, SELECT Count() in >SQLite is not optimized. It has recently been optimized, but only for the form: SELECT count(*) FROM without WHERE or LIMIT clauses. http://www.sqlite.org/cvstrac/chngview?cn=6316 >For big result sets, I might want to ju

Re: [sqlite] Compite with DSQLITE_THREADSAFE=1 but application has mulitple threads using the same connection

2009-06-09 Thread Kees Nuyt
P Joannek, I think this same issue was discussed very recently in the mailing list. You may want to consult the archives. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Compite with DSQLITE_THREADSAFE=1 but application has mulitple threads using the same connection

2009-06-10 Thread Kees Nuyt
ipp" <d...@hwaci.com> Date: Fri, 15 May 2009 14:03:05 -0400 Of course you have to search the ticket database. http://www.sqlite.org/cvstrac/search?t=1=1 Any problem ever reported is registered there. > >From: Kees Nuyt <k.n...@zonnet.nl> >T

Re: [sqlite] UPDATE with inline view/ derived table

2009-06-11 Thread Kees Nuyt
Not directly, but you can update "the tables behind" a view with an INSTEAD OF trigger. The trigger can contain any update statement you like. http://www.sqlite.org/lang_createtrigger.html#instead_of_trigger >Best regards. > >Frank -- ( Kees Nuyt ) c[_] __

Re: [sqlite] sql query with sqlite3_exec

2009-06-12 Thread Kees Nuyt
M urls", NULL, NULL, ); > >How can i save the returned result-table in a C string for further use in >the program? Have a look at some sample code: http://www.sqlite.org/cvstrac/wiki?p=SimpleCode http://www.sqlite.org/cvstrac/wiki?p=

Re: [sqlite] Database logic in TRIGGER and CONFLICT, or in software ?

2009-06-14 Thread Kees Nuyt
those constraints into TRIGGERs that implement them. http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers There's also a site that implements it: http://www.rcs-comp.com/site/index.php/view/Utilities-SQLite_foreign_key_trigger_generator >Simon. -- ( Kees Nuyt ) c[_] _

Re: [sqlite] Database inserts gradually slowing down

2009-06-16 Thread Kees Nuyt
ze - the number of INSERTs per transaction - The schema: INDEX PRIMARY KEY on the first column instead of a non-unique index (if the application allows it) - load the database in order of index(es) Especially a non-unique index with low cardinality has a lot

Re: [sqlite] search in archive

2009-06-19 Thread Kees Nuyt
ll only really help if your system has multiple processor cores, and if the databases are each on a different disk. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite3 data mode for emacs?

2009-06-21 Thread Kees Nuyt
in Emacs. There are several database browsers for SQLite databases though, with an editable grid. I use Sqlite3explorer, SqliteSpy and SqliteManager. The last one is a Firefox add-on. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list

Re: [sqlite] SQLite3 data mode for emacs?

2009-06-21 Thread Kees Nuyt
On Sun, 21 Jun 2009 12:44:51 -0700, Kelly Jones <kelly.terry.jo...@gmail.com> wrote: >On 6/21/09, Kees Nuyt <k.n...@zonnet.nl> wrote: >> On Sun, 21 Jun 2009 10:01:22 -0700, Kelly Jones >> <kelly.terry.jo...@gmail.com> wrote: >> >>>Emacs' "form

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-26 Thread Kees Nuyt
a connection open most of time. That's a good idea, for at least two reasons: - opening a connection has to parse the schema, and though it's fast code, it should be avoided. - the contents of the page cache aren't wasted, it may be re-used by subsequent statem

Re: [sqlite] View error

2009-06-29 Thread Kees Nuyt
rks when I execute the same request in the sqlite3 shell ... > >vw_last_cycles is a view listing the 10 last inserted rows of a table. > >any idea ? Yes, you say you SELECT ... FROM vw_last_cycles , but the code above references vw_last_cycles_mapping. &g

<    1   2   3   4   5   6   7   8   9   >