Re: [sqlite] Import skip first line

2013-05-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 31/05/13 05:34, Bart Smissaert wrote: > Importing a. csv file via the. import command of sqlite3.exe. As the > first line holds the field names I want to skip that. There is no > problem achieving this in code, but could I do this purely via

Re: [sqlite] Import skip first line

2013-05-31 Thread Larry Brasfield
Bart Smissaert wrote: That modified version sounds useful. Could you mail it? The source as modified is at http://www.filedropper.com/sqlite3modifiedshell . This includes a readline library that works on Win32. The SQLite library source is omitted for space. The shell incorporates the

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 2:33 PM, Spora wrote: > it is too complicated for me > OK then, why don't you ".dump" into a file, then do a regular-expression search and replace to quote all of the numbers. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora
it is too complicated for me Richard Hipp ha scritto quanto segue il 31/05/2013 20.29> On Fri, May 31, 2013 at 2:18 PM, Spora > wrote: I need a scriptable solution. Probably if you modify this line of code:

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 2:18 PM, Spora wrote: > I need a scriptable solution. > Probably if you modify this line of code: http://www.sqlite.org/src/artifact/46a1757c1?ln=395 so that the condition is always false and so that the else-clause is always taken, then the ".dump"

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora
I need a scriptable solution. Michael Black ha scritto quanto segue il 31/05/2013 20.08> So why don't you use SQLMaestro to import, then export it again. I would think that would quote it correctly. -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Michael Black
So why don't you use SQLMaestro to import, then export it again. I would think that would quote it correctly. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Spora Sent: Friday, May 31, 2013 1:01 PM To:

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 2:01 PM, Spora wrote: > But i see that sqlMaestro is able to do it. > How can he do? > I don't know. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Import skip first line

2013-05-31 Thread Bart Smissaert
That modified version sounds useful. Could you mail it? RBS On May 31, 2013 6:14 PM, "Larry Brasfield" wrote: > Bart Smissaert wrote: > >> Importing a. csv file via the. import command of sqlite3.exe. >> As the first line holds the field names I want to skip that. >>

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora
But i see that sqlMaestro is able to do it. How can he do? Richard Hipp ha scritto quanto segue il 31/05/2013 19.44> On Fri, May 31, 2013 at 1:32 PM, Spora > wrote: I have sqlite2 table: In sqlite2, everything is a string. So there is no solution

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 1:54 PM, Spora wrote: > I undstand, but now i have to import a large db2 in db3. > sqlite old.db .dump | sqlite3 new.db The above will probably cause your '01000' to be convert to '1000'. I don't think that can be helped without hacking on the ".dump"

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora
I undstand, but now i have to import a large db2 in db3. Richard Hipp ha scritto quanto segue il 31/05/2013 19.44> On Fri, May 31, 2013 at 1:32 PM, Spora > wrote: I have sqlite2 table: In sqlite2, everything is a string. So there is no solution

Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 1:32 PM, Spora wrote: > I have sqlite2 table: > In sqlite2, everything is a string. So there is no solution to your problem there. Please consider using sqlite3 instead. SQLite3 came out in 2004. The last release of sqlite2 was in 2005. The last

Re: [sqlite] numeric string quotation

2013-05-31 Thread Michael Black
I think you showed us the insert you do and not the .dump result. You need to ensure your inserted values are single-quoted. sqlite> create table test(alfa char(5) not null default ''); sqlite> insert into test values(01000); sqlite> .dump PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE

[sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora
I have sqlite2 table: CREATE TABLE test ( alfa char(5) NOT NULL default '', ); when i .dump i obtain: INSERT INTO test VALUES(01000); but when i import in sqlite3, i obtain test = '1000' and not test = '01000' because .dump create: INSERT INTO test VALUES(01000); and not: INSERT INTO test

Re: [sqlite] Import skip first line

2013-05-31 Thread Larry Brasfield
Bart Smissaert wrote: Importing a. csv file via the. import command of sqlite3.exe. As the first line holds the field names I want to skip that. There is no problem achieving this in code, but could I do this purely via sqlite3 commands? You could do it easily with a temporary table having an

Re: [sqlite] Avoiding table scans with complex queries

2013-05-31 Thread Paul Vercellotti
Clemens Ladisch wrote: >Try to put the FTS matches into a subquery (this is usually done to >avoid inefficient joins with the FTS tables): > >EXPLAIN QUERY PLAN >SELECT files.key FROM files, search_hierarchy >WHERE search_hierarchy.child = files.parent AND >( search_hierarchy.parent = 12 OR

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Dave Wellman
Hi Clemens, Thanks for the pointer although I'm doing this the other way around. I'm casting an INTEGER to a TEXT value. I think Michael is probably on the right track here, this is to do with operator precedence. Cheers, Dave Ward Analytics Ltd - information in motion Tel: +44 (0) 118

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Dave Wellman
Resend from correct account. Ward Analytics Ltd - information in motion Tel: +44 (0) 118 9740191 Fax: +44 (0) 118 9740192 www: http://www.ward-analytics.com Registered office address: The Oriel, Sydenham Road, Guildford, Surrey, United Kingdom, GU1 3SR Registered company number: 3917021

Re: [sqlite] numeric string quotation

2013-05-31 Thread Larry Brasfield
I have table: CREATE TABLE test ( alfa char(5) NOT NULL default '', ); when i .dump i obtain: INSERT INTO test VALUES(01000); but when i import in Mysql, i obtain test = '1000' and not test = '01000' because .dump create: INSERT INTO test VALUES(01000); and not: INSERT INTO test

Re: [sqlite] numeric string quotation

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 12:52 PM, Spora wrote: > I have table: > > CREATE TABLE test ( > alfa char(5) NOT NULL default '', > ); > > when i .dump i obtain: > > INSERT INTO test VALUES(01000); > I get INSERT INTO text VALUES('01000'); I tried this with older versions of

[sqlite] numeric string quotation

2013-05-31 Thread Spora
I have table: CREATE TABLE test ( alfa char(5) NOT NULL default '', ); when i .dump i obtain: INSERT INTO test VALUES(01000); but when i import in Mysql, i obtain test = '1000' and not test = '01000' because .dump create: INSERT INTO test VALUES(01000); and not: INSERT INTO test

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Clemens Ladisch
Dave Wellman wrote: > Why do I need the "()" around my calculation? says: | When casting a TEXT value to INTEGER, the longest possible prefix of | the value that can be interpreted as an integer number is extracted | from the TEXT value and the

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Michael Black
Your statement doesn't even work in MySQLas || is a logical operator there. And Oracle complains about your original query: SQL> select stepid ,'STEPID'||stepid ,stepid+5 ,'STEPID'||stepid+5,'STEPID'||5 from seqtable; select stepid ,'STEPID'||stepid ,stepid+5 ,'STEPID'||stepid+5,'STEPID'||5

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Simon Slavin
On 31 May 2013, at 4:38pm, "Dave Wellman" wrote: > select stepid ,'STEPID'||stepid ,stepid+5 ,'STEPID'||stepid+5 > ,'STEPID'||5 > > from seqnumber; > > > > A B CD E > > 5|STEPID5|10|5|STEPID5 Interesting: SQLite version 3.7.12

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Dave Wellman
Hi Richard, Many thanks, that works. Why do I need the "()" around my calculation? (apart from 'because that makes it work' !) I've used other dbms's and don't need them there. Cheers, Dave Ward Analytics Ltd - information in motion Tel: +44 (0) 118 9740191 Fax: +44 (0) 118 9740192 www:

Re: [sqlite] Concatenating literals with column values

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 11:38 AM, Dave Wellman wrote: > Running the following SQL does not seem to give consistent results. > select stepid ,'STEPID'||stepid ,stepid+5 ,'STEPID'||stepid+5 > ,'STEPID'||5 > > Maybe for column D you intended to say:

[sqlite] Concatenating literals with column values

2013-05-31 Thread Dave Wellman
Hi, Running the following SQL does not seem to give consistent results. If I concatenate a literal with a column containing a numeric value then I get expected results. (answers B and E below) If however I concatenate the literal with a numeric literal added to the column, I just get

Re: [sqlite] .net Sqlite lib reading date fields not working?

2013-05-31 Thread eschneider FE
I was just using the ;DateTimeKind= DateTimeKind.Utc But I just tested without any date settings and it works also. I have not tried your new method. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin Sent:

[sqlite] Android large file support patch

2013-05-31 Thread Pepijn Van Eeckhoudt
Sorry for the non-threaded reply. My subscription was set to digest mode... Patch is available at https://dl.dropboxusercontent.com/u/105584447/android_largefile.patch Pepijn ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Import skip first line

2013-05-31 Thread Bart Smissaert
Importing a. csv file via the. import command of sqlite3.exe. As the first line holds the field names I want to skip that. There is no problem achieving this in code, but could I do this purely via sqlite3 commands? RBS ___ sqlite-users mailing list

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
it's different (not the sqlite engine in c# but just the interface). The interface is up to date, and maintained with the core engine. But the binary is for x86 windows. On 31 May 2013 14:30, Bernd Lehmkuhl wrote: > This is not correct. It's up definitely up to date: > >

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Bernd Lehmkuhl
This is not correct. It's up definitely up to date: https://system.data.sqlite.org/downloads/1.0.86.0/sqlite-netFx35-binary-PocketPC-ARM-2008-1.0.86.0.zip Available at: https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki "This binary package contains all the binaries for the

Re: [sqlite] SQLite init file from PHP

2013-05-31 Thread fnoyanisi
Use http://php.net/manual/en/function.system.php Or http://www.php.net/manual/en/function.exec.php On 30/05/2013, at 10:41 PM, Lior Hazan wrote: > Dear All, > > If I'm using Command Line , I can use the next command > > sqlite.exe -init FILENAME file.db > This let me

Re: [sqlite] SQLite init file from PHP

2013-05-31 Thread Simon Slavin
On 30 May 2013, at 2:11pm, Lior Hazan wrote: > sqlite.exe -init FILENAME file.db > This let me init the SQLite with some parameters and it works great > > I wonder how can I do that using PHP? Can I ask what sort of thing you want to set with your parameters ? Simon.

[sqlite] SQLite init file from PHP

2013-05-31 Thread Lior Hazan
Dear All, If I'm using Command Line , I can use the next command sqlite.exe -init FILENAME file.db This let me init the SQLite with some parameters and it works great I wonder how can I do that using PHP? Thanks in advance Lior ___ sqlite-users

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
one last consideration, on android and ios (about the same CPU power), they use sqlite native, nota java translation. Is you application requiring c# in any way ? On 31 May 2013 13:28, Noel Frankinet wrote: > and it's already on year behind the official c sqlite. I

Re: [sqlite] Android large file support patch

2013-05-31 Thread Dan Kennedy
On 05/31/2013 03:01 PM, Pepijn Van Eeckhoudt wrote: Hi all, I've ran into some issues running sqlite on Android when handling files larger than 4Gb. Support for this counts on glibc style large file support where off_t and off64_t are identical. In bionic (Android C runtime) this is not the

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
and it's already on year behind the official c sqlite. I wouldn't go that route On 31 May 2013 13:26, Noel Frankinet wrote: > oh, yes everything in c# then, let's see the performance on an arm cpu ! > > > On 31 May 2013 13:23, Noel Frankinet

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
oh, yes everything in c# then, let's see the performance on an arm cpu ! On 31 May 2013 13:23, Noel Frankinet wrote: > ah, sorry, I will never understand why everybody wants to add a virtual > machine on an already feeble machine. Then you will have to deal wil a >

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
ah, sorry, I will never understand why everybody wants to add a virtual machine on an already feeble machine. Then you will have to deal wil a extra layer of complexity ( you need a assembly that will translate from managed code to unmanaged). You will probably have to compile it yourself, since

Re: [sqlite] Avoiding table scans with complex queries

2013-05-31 Thread Simon Slavin
On 31 May 2013, at 8:21am, Paul Vercellotti wrote: > If I change it to the following, by removing the first OR: > SELECT files.key FROM files, search_hierarchy, filename_fts, > file_comment_metadata > WHERE search_hierarchy.child = files.parent AND filename_fts.rowid = >

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread fnoyanisi
Once more, googling gives some handy stuff http://code.google.com/p/csharp-sqlite On 31/05/2013, at 8:46 PM, Ali Dirik wrote: > Thanks for answers. > > I use c# (VS2008) > I am looking for c# sample source code. > > > 2013/5/31 Noel Frankinet

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Ali Dirik
Thanks for answers. I use c# (VS2008) I am looking for c# sample source code. 2013/5/31 Noel Frankinet > I've used C++, do you want to use anything else. It's of course easier in > C++ since sqlite is in C. You link statically, nothing to install. > > > On 31 May

Re: [sqlite] Avoiding table scans with complex queries

2013-05-31 Thread Clemens Ladisch
Paul Vercellotti wrote: > I've got a very slow query that seems to be oh-so-close to running > quickly, and it seems to come down to handling of OR operators. > When the query has one OR criteria, it uses the correct indexes, but > when there are two, it does a table scan, which in this case

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
I've used C++, do you want to use anything else. It's of course easier in C++ since sqlite is in C. You link statically, nothing to install. On 31 May 2013 12:21, wrote: > This is the first shot from google > http://sqlite-wince.sourceforge.net/index.html > > If you'd like

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread fnoyanisi
This is the first shot from google http://sqlite-wince.sourceforge.net/index.html If you'd like to use sqlitecin your app, I do not think it will be an issue for any playform once you have the proper C compiler. You may try to statically compiling your application. On 31/05/2013, at 7:42 PM,

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Ali Dirik
Hello Noel Frankinet, Thank you for your answer. I using a hand-held terminal ( http://www.ute.com/products_info.php?pc1=1=3=0=703) with windows mobile operating system. We use this device for counting. There is already an application that works with SQLCE (Microsoft SQL Compact Edition) I want

Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Noel Frankinet
Hello Ali, I've done years ago, it's pretty much standard use. What do you want to do ? On 31 May 2013 10:19, Ali Dirik wrote: > Dear Friends, > > I want to develop a application that runs Windows CE or Mobile devices. > I want to use the Sqlite database. > May I find

[sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread Ali Dirik
Dear Friends, I want to develop a application that runs Windows CE or Mobile devices. I want to use the Sqlite database. May I find same sample source codes? Best Regards Ali D i rik ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Android large file support patch

2013-05-31 Thread Pepijn Van Eeckhoudt
Hi all, I've ran into some issues running sqlite on Android when handling files larger than 4Gb. Support for this counts on glibc style large file support where off_t and off64_t are identical. In bionic (Android C runtime) this is not the case. off_t is always 32-bit; for 64-bit offsets off64_t

[sqlite] Avoiding table scans with complex queries

2013-05-31 Thread Paul Vercellotti
Hi there, I've got a very slow query that seems to be oh-so-close to running quickly, and it seems to come down to handling of OR operators.  When the query has one OR criteria, it uses the correct indexes, but when there are two, it does a table scan, which in this case brings the query