Re: [sqlite] Update one table from matches in another

2011-08-10 Thread Martin Engelschalk
Hi, Am 10.08.2011 11:14, schrieb flakpit: To see what matches the location table with locations in the inventory table, I can issue the following command and it works returning 17 locations matched and is correct. There are 21 locations in the locations table but only 17 used in the inventory

Re: [sqlite] Update one table from matches in another

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 10:27am, Martin Engelschalk wrote: Am 10.08.2011 11:14, schrieb flakpit: I need to update the ItemCount column in the locations table with '1'when there is a corresponding match in the inventory table but using the query below marks all locations in the locations table so

Re: [sqlite] Update one table from matches in another

2011-08-10 Thread flakpit
update locations set ItemCount='1' where exists( select Location from hive where locations.Location=hive.Location ) Okay, seems that I wasn't too far off. Thank you very much for the help, I certainly needed it:):) update locations set ItemCount='0' where

Re: [sqlite] Update one table from matches in another

2011-08-10 Thread Igor Tandetnik
flakpit gary.flakhe...@gmail.com wrote: I was just using this to make sure my matches were going to be correct. select * from locations t1 where exists ( select * from hive t2 where t1.Location=t2.Location ) A slightly shorter form: select * from locations where Location in

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Hi, I have the results from the tests (below). Alot of the time is spent in checking file permissions and locking the file (40 %). Inmem % time seconds usecs/call callserrors syscall -- --- --- - - 28.530.124727

[sqlite] Data deleted

2011-08-10 Thread Malcolm Lander
I have just tried using SQLite pro. In the existing database I am trying to manipulate there are several tables. On trying to import a .csv file into one of them and replacing the current data in that table it works OK. However, all the data in one of the other tables also gets deleted

Re: [sqlite] Data deleted

2011-08-10 Thread Igor Tandetnik
Malcolm Lander land...@blueyonder.co.uk wrote: I have just tried using SQLite pro. In the existing database I am trying to manipulate there are several tables. On trying to import a .csv file into one of them and replacing the current data in that table it works OK. However, all the data

Re: [sqlite] Read only scaling optimization

2011-08-10 Thread Wiktor Adamski
Look at disc transfer. With 16 queries in one thread on single disc, disc may be accesed linearly (depeding on query). With 16 threads accesing disc at the same time linear disc access is impossible (however os may do some prefetching) and queries will by slower. You may try increasing page size -

Re: [sqlite] Update one table from matches in another

2011-08-10 Thread flakpit
You can do both in one pass: update locations set ItemCount = case when Location in (select Location from hive) then '1' else '0' end; Thanks for your help Igor, extremely elegant solution. -- View this message in context:

Re: [sqlite] Data deleted

2011-08-10 Thread Malcolm Lander
Thanks for the reply. It looks like this in the DDL is the culprit: CREATE TRIGGER [AircraftIDdeltrig] BEFORE DELETE ON [Aircraft] FOR EACH ROW BEGIN DELETE FROM Flights WHERE AircraftID = OLD.AircraftID;END; Is there a way to disable it? On 10/08/2011 13:14, Igor Tandetnik wrote: Malcolm

Re: [sqlite] Data deleted

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 1:27pm, Malcolm Lander wrote: Thanks for the reply. It looks like this in the DDL is the culprit: CREATE TRIGGER [AircraftIDdeltrig] BEFORE DELETE ON [Aircraft] FOR EACH ROW BEGIN DELETE FROM Flights WHERE AircraftID = OLD.AircraftID;END; Is there a way to disable

Re: [sqlite] Data deleted

2011-08-10 Thread Malcolm Lander
Thanks for that. Although that disables the DDL trigger, on running the import I get a abort due to constraint violation error: Exception: - 2.1 Date : Wed, 10 Aug 2011 13:35:56 +0100 2.2

Re: [sqlite] Read only scaling optimization

2011-08-10 Thread Alexey Pechnikov
2011/8/10 Wiktor Adamski bardzotajneko...@interia.pl: You may try increasing page size - bigger block means less near-random reads from the disc. It's good way. With page size 8k instead of default 1k selects performance may increasing ~3x. Note: PostgreSQL use 8k disk pages. -- Best

Re: [sqlite] Data deleted

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 1:39pm, Malcolm Lander wrote: Thanks for that. Although that disables the DDL trigger, on running the import I get a abort due to constraint violation error: You will probably need to import data into the TABLEs in an order that suits the data hierarchy. For instance,

Re: [sqlite] Data deleted

2011-08-10 Thread Malcolm Lander
Thanks again, I will have a go at that On 10/08/2011 13:53, Simon Slavin wrote: On 10 Aug 2011, at 1:39pm, Malcolm Lander wrote: Thanks for that. Although that disables the DDL trigger, on running the import I get a abort due to constraint violation error: You will probably need to

Re: [sqlite] Read only scaling optimization

2011-08-10 Thread Drew Kozicki
To Answer several questions at once. Simon, Just checking: by 'queries' you mean 'SELECT', right ? You're not making changes, just searching Yes to optimize we average about 5-6 indexes per table. D. Richard Hipp, Open a separate database connection for each thread. Don't try to use the same

[sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Simon Slavin
I've never tried using this before for some reason but in a recent OS X version of the command-line shell I tried using .mode html today. The content is fine, but it doesn't do TABLE or /TABLE. Intentional ? Bug ? Oversight ? Trying hard to believe I'm not the first person who has tried

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 11:43 AM, Simon Slavin slav...@bigfraud.org wrote: I've never tried using this before for some reason but in a recent OS X version of the command-line shell I tried using .mode html today. The content is fine, but it doesn't do TABLE or /TABLE. Intentional ? Bug

[sqlite] SQLite + unicode

2011-08-10 Thread NOCaut
Where i can find c++ unicode unit for work with SQLite database? Thanks. -- View this message in context: http://old.nabble.com/SQLite-%2B-unicode-tp32235242p32235242.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/10/2011 09:13 PM, Simon Slavin wrote: The content is fine, but it doesn't do TABLE or /TABLE. My shell copies the SQLite shell and also outputs only rows. The reason is that multiple statements could be used to generate output so you do not

Re: [sqlite] SQLite + unicode

2011-08-10 Thread Igor Tandetnik
On 8/10/2011 11:55 AM, NOCaut wrote: Where i can find c++ unicode unit for work with SQLite database? Thanks. What kind of unit? What is it that you want to do, but cannot, without such a unit? -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Black, Michael (IS)
If you want it just DIY... .mode html select table; select * from stuff; select /table; Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org

Re: [sqlite] SQLite + unicode

2011-08-10 Thread NOCaut
Sorry for my bad english)) I want find source code for work with sqlite.. -- View this message in context: http://old.nabble.com/SQLite-%2B-unicode-tp32235242p32235334.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users

Re: [sqlite] SQLite + unicode

2011-08-10 Thread Stephan Beal
On Wed, Aug 10, 2011 at 5:55 PM, NOCaut per...@mail.ru wrote: Where i can find c++ unicode unit for work with SQLite database? Thanks. If you're looking for a generic unicode C++ library i can highly recommend: http://utfcpp.sourceforge.net/ it's easy to use, header-only, and liberally

Re: [sqlite] SQLite + unicode

2011-08-10 Thread NOCaut
in the other forum say: You can get the SQLite source code and compile it directly with C++ Builder (2010 and XE tested). Come to home and see -- View this message in context: http://old.nabble.com/SQLite-%2B-unicode-tp32235242p32235384.html Sent from the SQLite mailing list archive at

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Simon Slavin
Thanks to everyone, including Michael for a fast work-around. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite + unicode

2011-08-10 Thread Igor Tandetnik
On 8/10/2011 12:08 PM, NOCaut wrote: in the other forum say: You can get the SQLite source code and compile it directly with C++ Builder (2010 and XE tested). If you need SQLite source code, it's here: http://sqlite.org/download.html . See also http://sqlite.org/amalgamation.html -- Igor

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Kit
2011/8/10 Simon Slavin slav...@bigfraud.org: I've never tried using this before for some reason but in a recent OS X version of the command-line shell I tried using .mode html today.  The content is fine, but it doesn't do TABLE or /TABLE. Intentional ?  Bug ?  Oversight ?  Trying hard to

[sqlite] tcl incrblob interface

2011-08-10 Thread Victor Mayevski
Hello, I am trying to learn how to use the incrblob command in the Tcl interface and I can't get it to work. I create a one column table t, insert one empty value into it, than do db incrblob t a 1, which works fine, I get a file pointer back incrblob_1. Then I do puts incrblob_1 hello world,

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Brian Curley
Depending on your preferred shell...the sqlite CLI is just crazy flexible. Just pipe your output through sed for upper/lower preferences. On Aug 10, 2011 12:18 PM, Kit kit.sa...@gmail.com wrote: 2011/8/10 Simon Slavin slav...@bigfraud.org: I've never tried using this before for some reason but

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Black, Michael (IS)
If you don't like upper case then change the code and re-compile. That's the nice part of source code. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org

Re: [sqlite] SQLite + unicode

2011-08-10 Thread NOCaut
I work in VS2008 c++ i create data base my.db and wont use U N I C O D E function from this DLL i find class or unit for connect to my base from VS2008 http://sqlite.org/download.html - this link help me? you understand me? -- View this message in context:

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
The 179148 failures on 'access' system call is due to access check of two files - the journal file and the wal-file. The journal mode was OFF as also WAL mode. Why is sqlite checking access permissions for this file 179140 times? Removing or optimising this will make it faster by 20% atleast!

Re: [sqlite] tcl incrblob interface

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 12:24 PM, Victor Mayevski vit...@gmail.com wrote: Hello, I am trying to learn how to use the incrblob command in the Tcl interface and I can't get it to work. I create a one column table t, insert one empty value into it, than do db incrblob t a 1, which works fine,

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 12:40 PM, Sreekumar TP sreekumar...@gmail.comwrote: The 179148 failures on 'access' system call is due to access check of two files - the journal file and the wal-file. The journal mode was OFF as also WAL mode. Why is sqlite checking access permissions for this file

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Kit
2011/8/10 Brian Curley bpcur...@gmail.com: Depending on your preferred shell...the sqlite CLI is just crazy flexible. Just pipe your output through sed for upper/lower preferences. It is not entirely primitive. It needs only tags in lowercase. cite href=http://www.sqlite.org/sqlite.html; The

Re: [sqlite] SQLite + unicode

2011-08-10 Thread Doug Currie
On Aug 10, 2011, at 12:39 PM, NOCaut wrote: I work in VS2008 c++ i create data base my.db and wont use U N I C O D E function from this DLL i find class or unit for connect to my base from VS2008 http://sqlite.org/download.html - this link help me? you understand me? No, but maybe

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Thanks for the explanation. The journal mode was OFF which means there is no journal file created. So why is it the check still performed ? On Wed, Aug 10, 2011 at 10:24 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Aug 10, 2011 at 12:40 PM, Sreekumar TP sreekumar...@gmail.com wrote: The

Re: [sqlite] SQLite + unicode

2011-08-10 Thread Igor Tandetnik
On 8/10/2011 12:39 PM, NOCaut wrote: I work in VS2008 c++ i create data base my.db and wont use U N I C O D E function from this DLL Why won't you? Which DLL is 'this DLL'? i find class or unit for connect to my base from VS2008 http://sqlite.org/download.html - this link help me? I

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Brian Curley
Then you'd need your sed regex to handle that mask accordingly. The CLI is understandably your best friend in this case. A rogue's gallery just awaiting you to tell it what to do...I prefer to model my app using views, and feed it .import files. You might even replace time and date retrieval

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 5:58pm, Kit wrote: 2011/8/10 Brian Curley bpcur...@gmail.com: Depending on your preferred shell...the sqlite CLI is just crazy flexible. Just pipe your output through sed for upper/lower preferences. It is not entirely primitive. It needs only tags in lowercase. cite

[sqlite] Constraint failed infos

2011-08-10 Thread Julien Laffaye
Hello, Is it possible to get more info when I get a constraint failed error from the C API? I am interested in the column name, table name and type of constraint. Regards, Julien ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 6:01pm, Sreekumar TP wrote: Thanks for the explanation. The journal mode was OFF which means there is no journal file created. So why is it the check still performed ? Because the journal mode might have been 'ON' the last time that database was used. On Wed, Aug 10,

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Brian Curley
@Simon: I'd disagree, unless you mean to make it less specific, since it's really an exercise for the reader to infer mark-up...not just HTML over XHTML. But that's just me... On Aug 10, 2011 1:06 PM, Simon Slavin slav...@bigfraud.org wrote: On 10 Aug 2011, at 5:58pm, Kit wrote: 2011/8/10

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 6:10pm, Brian Curley wrote: @Simon: I'd disagree, unless you mean to make it less specific, since it's really an exercise for the reader to infer mark-up...not just HTML over XHTML. But that's just me... The SQLite page states specifically XHTML:

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
The journal mode was always OFF when the code executes. The db was/is never opened with a journal. I havent analysed when exactly these calls are made, but definitely, it quite a lot.. On Wed, Aug 10, 2011 at 10:39 PM, Simon Slavin slav...@bigfraud.org wrote: On 10 Aug 2011, at 6:01pm,

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 1:09 PM, Simon Slavin slav...@bigfraud.org wrote: On 10 Aug 2011, at 6:01pm, Sreekumar TP wrote: Thanks for the explanation. The journal mode was OFF which means there is no journal file created. So why is it the check still performed ? Because the journal mode

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Ok, its getting a bit clear. If there is only one process that is writing to the database, but has more than one process that reads the database, the locking mode can still be exclusive ? If the other process opens the db connection as read_only, will the hot journal check be still done (during

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 1:35 PM, Sreekumar TP sreekumar...@gmail.comwrote: Ok, its getting a bit clear. If there is only one process that is writing to the database, but has more than one process that reads the database, the locking mode can still be exclusive ? PRAGMA

Re: [sqlite] Shell doesn't do TABLE/TABLE

2011-08-10 Thread Kit
2011/8/10 Simon Slavin slav...@bigfraud.org: However, the tags the shell tool generates are upper case.  There are two possible fixes: a) change the tool to generate lower-case tags. b) change the documentation to say that the tags are HTML, not XHTML. Simon. OK, here is the patch. -- Kit

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Pavel Ivanov
If you have one reader and many writers, consider PRAGMA journal_mode=WAL; Richard meant one writer and many readers of course. If the other process opens the db connection as read_only, will the hot journal check be still done (during queries operations of the second process)? How is the

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Ok.. But I sqlite can still check the number of db connections open and optimise the checking= as long as there is only one writer, do not check for hot journals. Can a database have two connections opened with two different journal modes ? On Wed, Aug 10, 2011 at 11:35 PM, Pavel Ivanov

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 2:13 PM, Sreekumar TP sreekumar...@gmail.comwrote: But I sqlite can still check the number of db connections open No it cannot. In unix, there is no way for one process to know whether or not another process has a particular file open. And if there is a mechanism to

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Oh Yes. I missed that point ! On Wed, Aug 10, 2011 at 11:57 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Aug 10, 2011 at 2:13 PM, Sreekumar TP sreekumar...@gmail.com wrote: But I sqlite can still check the number of db connections open No it cannot. In unix, there is no way for

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Black, Michael (IS)
Under Linux: man fuser Will detect other processes which have the DB open. It's done by looking at all the /proc entries. Under windows http://www.codeproject.com/KB/IP/OpenFiles.aspx Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From:

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Pavel Ivanov
But I sqlite can still check the number of db connections open Even though as Michael have shown this is possible (with guaranteed results only when run as root) it will still have races. Because if you see only one process accessing database file at the end of transaction and only one process

[sqlite] sqlite-src-3070701.zip compilation issues

2011-08-10 Thread Raja Kondu
Hi, I have downloaded the SQLite version 3.7.7.1 from the *Legacy Source Code Distribution Formats . * ** Here I am just compiling the source code from the src folder and I am seeing lot of compilation errors by saying the header files missing and some of the header files are really missing.

[sqlite] sqlite3_wal_checkpoint wrror

2011-08-10 Thread Lisa Davey
Hi, I'm getting an error message whenever I reboot my computer stating procedure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library sqlite3.dll How do I fix this? Thanks ___ sqlite-users mailing list

Re: [sqlite] sqlite3_wal_checkpoint wrror

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 9:15 PM, Lisa Davey steinwa...@gmail.com wrote: Hi, I'm getting an error message whenever I reboot my computer stating procedure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library sqlite3.dll How do I fix this? Reinstall iTunes. What

Re: [sqlite] sqlite3_wal_checkpoint wrror

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 9:35 PM, Lisa Davey steinwa...@gmail.com wrote: In the past few weeks I installed uptates to Bonjour, itues, safari, apple application support. A program called HyperCam 3, The Garmin communicator plugin and usb drivers. And you don't know which of these was the last

[sqlite] how let readonly connection wait for locked database ?

2011-08-10 Thread Wenbo Zhao
Hi guys, I want a readonly connection wait for locked database instead of error return immediately. The question is equivalence to how to let a reaonly connection have busy_handler triggered when the database is locked. In my practice, the readonly connection will fail when db locked and

Re: [sqlite] how let readonly connection wait for locked database ?

2011-08-10 Thread Simon Slavin
On 11 Aug 2011, at 3:35am, Wenbo Zhao wrote: I want a readonly connection wait for locked database instead of error return immediately. The question is equivalence to how to let a reaonly connection have busy_handler triggered when the database is locked. In my practice, the readonly

Re: [sqlite] sqlite-src-3070701.zip compilation issues

2011-08-10 Thread sreekumar . tp
Pls list the compilation errors.. --Original Message-- From: Raja Kondu Sender: sqlite-users-boun...@sqlite.org To: sqlite-users@sqlite.org ReplyTo: General Discussion of SQLite Database Subject: [sqlite] sqlite-src-3070701.zip compilation issues Sent: Aug 11, 2011 4:36 AM Hi, I have