[sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Sean Moss-Pultz
Hi List Here's basically what I'm doing: sqlite create table test(t text); sqlite insert into test values(0123); sqlite select * from test; 123 How can I get the string to stay 0123? I've read the docs about Column Affinity. But I guess I'm not smart enough to figure this out :-) BTW,

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Moss-Pultz wrote: How can I get the string to stay 0123? It isn't a string - you supplied an integer and SQLite treated it that way and then stored it. If you really wanted a string then you must quote it (remember to use single quotes). If

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Dan Bishop
Sean Moss-Pultz wrote: Hi List Here's basically what I'm doing: sqlite create table test(t text); sqlite insert into test values(0123); sqlite select * from test; 123 How can I get the string to stay 0123? I've read the docs about Column Affinity. But I guess I'm not smart

[sqlite] sqlite_exec() encoding?

2009-09-27 Thread aj
what encoding does sqlite_exec() callback function receive data in ? some tests i've done seem to suggest UTF-8 other tests show chars U+80 to U+FF are returned as single chars with values 128-255. (suggesting its not UTF-8) where is *any* documentation about this? -- Not sent from an

Re: [sqlite] sqlite_exec() encoding?

2009-09-27 Thread Simon Slavin
On 26 Sep 2009, at 2:04pm, aj wrote: what encoding does sqlite_exec() callback function receive data in ? some tests i've done seem to suggest UTF-8 other tests show chars U+80 to U+FF are returned as single chars with values 128-255. (suggesting its not UTF-8) That would be some kind of

Re: [sqlite] sqlite_exec() encoding?

2009-09-27 Thread Igor Tandetnik
aj wrote: what encoding does sqlite_exec() callback function receive data in ? some tests i've done seem to suggest UTF-8 other tests show chars U+80 to U+FF are returned as single chars with values 128-255. (suggesting its not UTF-8) This means that these strings were inserted this way

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Sean Moss-Pultz
Hi Roger Thanks a lot for such a quick reply... On Sun, Sep 27, 2009 at 3:18 PM, Roger Binns rog...@rogerbinns.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Moss-Pultz wrote: How can I get the string to stay 0123? It isn't a string - you supplied an integer and SQLite

[sqlite] database locking

2009-09-27 Thread Sean Moss-Pultz
Hi List I have a python script that runs 3 instances simultaneously on a quadcore x86 system. I'm not using the multiprocessing libraries. The programs are just run in parallel. They all access (for reading only) a single sqlite3 database. I'm setting the following pragma commands:

Re: [sqlite] sqlite_exec() encoding?

2009-09-27 Thread Jay A. Kreibich
On Sat, Sep 26, 2009 at 11:04:17PM +1000, aj scratched on the wall: what encoding does sqlite_exec() callback function receive data in ? some tests i've done seem to suggest UTF-8 other tests show chars U+80 to U+FF are returned as single chars with values 128-255. (suggesting its not

Re: [sqlite] Tedious CSV import question

2009-09-27 Thread A. H. Ongun
I recently had to import an Excel based database into an SQL database. To complicate the matters data was all over the place in each file (3 separate tables in a single CSV file), and some numbers had commas (e.g. 8,253.45). I used the Perl CSV module to read in each file (1500+) line at a

Re: [sqlite] Tedious CSV import question

2009-09-27 Thread Nuno Lucas
C. Mundi wrote: I'm hoping someone will (please) tell me I missed something in the sqlite docs. Otherwise, I guess I'll be using python's csv module to turn my CSV file into SQL insert statements. This is likely to be an infequent task, but it has to be done perfectly. So if someone knows

Re: [sqlite] inserting a number as a string and keeping it that way

2009-09-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Moss-Pultz wrote: OK. Then I'm going to need to escape this string since the insert is really coming from a import of a huge datadump generated in Python. You should probably explain the big picture first. Python has at least two wrappers

Re: [sqlite] Tedious CSV import question

2009-09-27 Thread C. Mundi
@Nuno: hey that is really nice. Thank you! On 9/27/09, Nuno Lucas ntlu...@gmail.com wrote: C. Mundi wrote: I'm hoping someone will (please) tell me I missed something in the sqlite docs. Otherwise, I guess I'll be using python's csv module to turn my CSV file into SQL insert statements.

[sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-27 Thread Dr. David Kirkby
sqlite3.c, line 18731: warning: integer overflow detected: op sqlite3.c, line 18748: warning: integer overflow detected: op sqlite3.c, line 32546: warning: statement not reached sqlite3.c, line 69160: warning: integer overflow detected: op ___

Re: [sqlite] FTS3 phantom token?...

2009-09-27 Thread Scott Hess
On Sat, Sep 26, 2009 at 5:31 PM, P Kishor punk.k...@gmail.com wrote: On Sat, Sep 26, 2009 at 6:36 PM, marbex marb...@gmail.com wrote: Shopsland gmail wrote:    select title from fts_news where fts_news match 'ined' It looks that you only want to query the title field, so the query should be:

Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dr. David Kirkby wrote: sqlite3.c, line 18731: warning: integer overflow detected: op sqlite3.c, line 18748: warning: integer overflow detected: op sqlite3.c, line 32546: warning: statement not reached sqlite3.c, line 69160: warning: integer

[sqlite] less typing possible ?

2009-09-27 Thread Stef Mientki
hello, I often want to see most of the columns of a table / view / query, but a few I don't want to see. So I now create a huge list of fields, but isn't there a more typo-frindly way, like : select * - field33 from table thanks, Stef Mientki ___

[sqlite] SELECT ALL BUT syntax (was Re: less typing possible ?)

2009-09-27 Thread Darren Duncan
Stef Mientki wrote: hello, I often want to see most of the columns of a table / view / query, but a few I don't want to see. So I now create a huge list of fields, but isn't there a more typo-frindly way, like : select * - field33 from table A syntax option introduced in Date and

Re: [sqlite] SQLite JDBC - org.sqlite.NativeDB.step taking up too much time

2009-09-27 Thread George Bills
This makes a lot of sense now - I haven't read up on the C interface and assumed that step was a JDBC thing. Thanks for clearing that up. George. On 09/26/2009 01:01 AM, Pavel Ivanov wrote: Does anyone know why this method might be so expensive? Because it's main method to execute your

[sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Darren Duncan
Following my previous message to the sqlite-users list, I've done a bit more research and decided to escalate my reply to a formal feature request. I was initially going to file a ticket, but it seems that non-registered SQLite developers can't do that anymore, and we're supposed to do it on

Re: [sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Jean-Christophe Deschamps
Darren, At 02:19 28/09/2009, you wrote: ´¯¯¯ So my proposed select list minuend is identical to the old select sublist, and my addition is the optional EXCEPT plus list of not derived columns. Note that I'm not stuck on the keyword EXCEPT, but it should be a word that reads similarly. `--- I

Re: [sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Jean-Christophe Deschamps
Oops, let me try again! SELECT ALLBUT foo FROM t ... Typing error! Should be SELECT * ALLBUT foo FROM t ... Could be as well SELECT * BUTNOT foo, bar FROM t ... The risk seems much higher with words like SAFE or WITHOUT, which perhaps have greater probability of being used in some fuure

Re: [sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Darren Duncan
Jean-Christophe Deschamps wrote: Darren, At 02:19 28/09/2009, you wrote: ´¯¯¯ So my proposed select list minuend is identical to the old select sublist, and my addition is the optional EXCEPT plus list of not derived columns. Note that I'm not stuck on the keyword EXCEPT, but it should

Re: [sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Darren Duncan wrote: I was initially going to file a ticket, but it seems that non-registered SQLite developers can't do that anymore, and we're supposed to do it on sqlite-users where a non-registered developer would then distill list chatter

Re: [sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Darren Duncan
Roger Binns wrote: intended for use in situations where users do want most of the fields from a source but don't want a few. What is the harm in the extra fields being returned? Sure they take up a few bytes more space but that isn't a big deal. In tables where there may be a large

Re: [sqlite] feature request - field exclusion list in select list

2009-09-27 Thread Stephan Wehner
On Sun, Sep 27, 2009 at 5:19 PM, Darren Duncan dar...@darrenduncan.net wrote: Following my previous message to the sqlite-users list, I've done a bit more research and decided to escalate my reply to a formal feature request. I was initially going to file a ticket, but it seems that

[sqlite] Access violation in sqlite3.dll

2009-09-27 Thread meng wei
Hi everyone! I met no problem with win32 console application,but when it turn to MFC in Visual C++,the same code dosen't work. Anyone can give me some suggestion? Thanks in advance! *The error is:* Unhandeled exception in xxx.exe(sqlite3.dll)0xC005 Access Violation *More output:* Loaded