Re: [sqlite] problems on importing quoted csv files

2011-05-17 Thread Andrew Sigmund
Justin, If you're comfortable with perl, try perl's Text::CSV module with DBD::SQLite. I have used Text::CSV, which has a good set of format options that it parses. I have not used DBD::SQLite myself. Andy -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] problems on importing quoted csv files

2011-05-17 Thread Sylvain Pointeau
I made one, as a command line tool. the announcement: http://spointeau.blogspot.com/2011/03/sylisa-csv2db-is-born.html the sources: https://gitorious.org/sylisa-csv2db/sylisa-csv2db Another option, you can also use the shell (in python) apsw http://apidoc.apsw.googlecode.com/hg/index.html

[sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Hello everyone, I don't understand why when I use the sqlite3_prepare_v2() function, some bind_xxx, and then commit, the data stored in my database are redundant.. To be more precise, when I run my code (see below), I obtain this in my database : 1|s||| 2|s|t|| 3|s|t|y| 4|s|t|y|ve

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/17/2011 02:22 AM, StyveA wrote: I don't understand why when I use the sqlite3_prepare_v2() function, some bind_xxx, and then commit, the data stored in my database are redundant.. To be more precise, when I run my code (see below), I obtain

[sqlite] Query efficiency

2011-05-17 Thread Matthew Jones
O.k. So this is a very cut down example but it illustrates the question: sqlite create table a (a_id int primary key); sqlite create table b (b_id int primary key); sqlite create table ab (a_id int, b_id int, primary key(a_id, b_id)); sqlite create table a_relation (a_id1 int, a_id2, primary

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Roger Binns wrote: http://www.sqlite.org/c3ref/clear_bindings.html Roger thanks for replying, but I've tried with it (sqlite3_clear_bindings) just now and the result obtained is : 1|s||| 2 3 4 Am I using it in a wrong way? (just resplacing all sqlite3_reset by it) --

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread Michael Steiger
On 17.05.2011 11:22 StyveA said the following: Hello everyone, I don't understand why when I use the sqlite3_prepare_v2() function, some bind_xxx, and then commit, the data stored in my database are redundant.. To be more precise, when I run my code (see below), I obtain this in my

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Michael Steiger-2 wrote: You need to prepare bind all variables (not just one) step ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users It works great ! Thanks for your

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Hello again, I've got an other question about prepare : Is it possible to make a BEGIN transaction, then prepare many statements (insert, update, delete) and then COMMIT all at once in the right order? Or should I each time make a BEGIN, prepare, COMMIT? -- View this message in context:

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread Jim Morris
Yes, transaction are designed to work with multiple statements. Begin Statement 1 Statement 2 ... Statement N Commit On 5/17/2011 7:58 AM, StyveA wrote: Hello again, I've got an other question about prepare : Is it possible to make a BEGIN transaction, then prepare many statements (insert,

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread Igor Tandetnik
On 5/17/2011 10:58 AM, StyveA wrote: I've got an other question about prepare : Is it possible to make a BEGIN transaction, then prepare many statements (insert, update, delete) and then COMMIT all at once in the right order? Or should I each time make a BEGIN, prepare, COMMIT? Prepare

[sqlite] How to install and configure SQLite on ipad.

2011-05-17 Thread irfan khan
Hi, I am new with SQLite and have to configure on ipad, can ou please send me steps or any related documents please. -- Thanks Regards Irfan Khan ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] How to install and configure SQLite on ipad.

2011-05-17 Thread Simon Slavin
On 17 May 2011, at 5:56pm, irfan khan wrote: I am new with SQLite and have to configure on ipad, can ou please send me steps or any related documents please. There is nothing to configure. Your application will include SQLite and will do all its configuration for you. Simon.

Re: [sqlite] How to install and configure SQLite on ipad.

2011-05-17 Thread irfan khan
Thanks a lot for your replay. But we are developing new application for ipad for some buisseness need and need to configure sqllite database for the same. I am MS SQL database administrator and my developer team asked me to configure sqlite for ipad. please send me any related documents or

Re: [sqlite] How to install and configure SQLite on ipad.

2011-05-17 Thread Simon Slavin
On 17 May 2011, at 6:16pm, irfan khan wrote: But we are developing new application for ipad for some buisseness need and need to configure sqllite database for the same. Ah, you are an iOS programmer ! SQLite is not a library, and you do not download a compiled library. it consists of

Re: [sqlite] Query efficiency

2011-05-17 Thread Pavel Ivanov
That is, is leaving it to the query optimiser to figure out that I only need the sub select once the best thing to do? AFAIK, SQLite's optimizer is not that smart to collapse two identical sub-queries and reuse once generated result. Is the select I'm doing where both a_id1 2 are in the

Re: [sqlite] How to install and configure SQLite on ipad.

2011-05-17 Thread Tim Butterfield
iOS has SQLite embedded in it. Add the libsqlite3.dylib framework toyour Xcode project. This is a /usr/lib alias, not the specific version of libsqlite3.0.dylib. Include your SQLite db file in your Xcode project for copying to the target or let it get created when you open it. #import

[sqlite] sqlite and impersonation on Windows (Bug / feature request)

2011-05-17 Thread Robert Myers
When running in Windows under SYSTEM context, such as in a service, there are issues when using impersonation and trying to update a sqlite database. How to reproduce: 1. In SYSTEM context, create a directory that only SYSTEM as access to. 2. Open/ create a database in this directory. All

[sqlite] Bug or not: WAL file is not auto-checkpointed when transaction finishes

2011-05-17 Thread Nikolaus Rath
Hi, Please consider the attached testcase. The WAL file should grow to at most 1 MB. This limit is exceeded, because the script adds data while a second cursor has an active SELECT query. However, when the SELECT query finishes, the WAL file is not auto-checkpointed either. An access pattern

[sqlite] Is is it possible to close the random rowid gaps in a sqlite table?

2011-05-17 Thread Frank Chang
Hi, I just ran this sqlite command to randomly delete 20% of the rows in a 15000 row sqlite table. DELETE FROM TABLE WHERE ROWID IN (SELECT ROWID FROM TABLE ORDER BY RANDOM() LIMIT 3000) Now there are gaps in the rowid in the modified table. I was wondering if it was possible to

Re: [sqlite] Is is it possible to close the random rowid gaps in a sqlite table?

2011-05-17 Thread Nico Williams
On Tue, May 17, 2011 at 7:37 PM, Frank Chang frank_chan...@hotmail.com wrote:   Hi, I just ran this sqlite command to randomly delete 20% of the rows in a 15000 row sqlite table. DELETE FROM TABLE WHERE ROWID IN (SELECT ROWID FROM TABLE ORDER BY RANDOM() LIMIT 3000)       Now there are gaps

[sqlite] strftime function: requesting %U support

2011-05-17 Thread James Berry
It would be neat if the sqlite strftime function could support the %U conversion, to give Week of Year, where a week starts on Sunday. As it is, there's a bit of an impedance mismatch, as %w gives day of week where 0 == Sunday, but the supported %W conversion gives Week of Year, where week