Re: [sqlite] Insert mode shows wrong type

2009-04-03 Thread BareFeet
Hi Jay, Thanks for the reply. > Asking SQLite for the insert statement doesn't tell you what the > type in the database is Shouldn't it? It doesn't seem that any output mode in the sqlite3 command will distinguish types. CSV sometimes quotes text, sometimes doesn't. And now it seems insert

Re: [sqlite] Insert mode shows wrong type

2009-04-03 Thread Jay A. Kreibich
On Sat, Apr 04, 2009 at 02:22:33PM +1100, BareFeet scratched on the wall: > Hi all, > > If I have a text column, insert text into it, the ask SQLite for the > insert statement, shouldn't it show a text result? SQLite appears to > coerce it to a number if it can, but shouldn't. Asking SQLite

[sqlite] Insert mode shows wrong type

2009-04-03 Thread BareFeet
Hi all, If I have a text column, insert text into it, the ask SQLite for the insert statement, shouldn't it show a text result? SQLite appears to coerce it to a number if it can, but shouldn't. Here's an example: .mode insert create temp table "Test" (MyString text); insert into Test values

Re: [sqlite] Calculating the size of a backup

2009-04-03 Thread D. Richard Hipp
On Apr 3, 2009, at 5:04 PM, Brown, Daniel wrote: > After a bit of digging I think (PRAGMA) page_count * (PRAGMA) > page_size is roughly the size of the database but is the actual > database file that size. Is there a header to take into account too? The header is included in the page_count.

Re: [sqlite] Calculating the size of a backup

2009-04-03 Thread Brown, Daniel
After a bit of digging I think (PRAGMA) page_count * (PRAGMA) page_size is roughly the size of the database but is the actual database file that size. Is there a header to take into account too? > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...

[sqlite] C++ Samples

2009-04-03 Thread centipede moto
I am new to c++ (I know php, c# etc), and thanks to this list I've gotten sqlite3 to open a db connection without failing to find its libraries. But now that I have an open db connection I am lost, I can work my way through the c++ itself but I'm having a hard time finding c++ sqlite3 samples,

[sqlite] Calculating the size of a backup

2009-04-03 Thread Brown, Daniel
Good Morning List, Is there any way to calculate the size of a database backup before doing a backup? I need to know how big the backup database is going to before I call the new backup API: as the backup database is using an in memory VFS. Cheers, Daniel Brown | Software Engineer "The best l

Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Dave Brown
Well the problem is this is happening on our customer's computers. Haven't been able to see it here yet...will keep trying. But we get reports of this about once a week. On Fri, Apr 3, 2009 at 10:35 AM, Sherief N. Farouk wrote: > > Hi - it only happens on Windows systems that are using U3 USB ke

Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Sherief N. Farouk
> Hi - it only happens on Windows systems that are using U3 USB keys. > None of > the queries are intensive - they are pretty simple and shouldn't take > longer > than a few milliseconds. > > On harddisks it *always* works. Never had an issue there. > Like Teg said, you can use procmon in additi

Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Teg
Hello Dave, Friday, April 3, 2009, 12:16:37 PM, you wrote: DB> Hi - it only happens on Windows systems that are using U3 USB keys. None of DB> the queries are intensive - they are pretty simple and shouldn't take longer DB> than a few milliseconds. DB> On harddisks it *always* works. Never had a

Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Dave Brown
Hi - it only happens on Windows systems that are using U3 USB keys. None of the queries are intensive - they are pretty simple and shouldn't take longer than a few milliseconds. On harddisks it *always* works. Never had an issue there. On Fri, Apr 3, 2009 at 5:15 AM, Emil Obermayr wrote: > On T

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Sylvain Pointeau
it is really perfect,thank you so much On Fri, Apr 3, 2009 at 2:55 PM, Simon Davies < simon.james.dav...@googlemail.com> wrote: > 2009/4/3 Sylvain Pointeau : > > re-hi, > > but how do we do if we are on unix and there is some CR on those field? > > I cannot insert CR in my statement (only line fe

[sqlite] sqlite3_step() returning SQLITE_OK

2009-04-03 Thread Radcon Entec
According to the documentation, assuming I'm reading it correctly, and assuming there are no locks on the database, and assuming the query sent to sqlite3_prepare_v2() was valid, sqlite3_step() should return either SQLITE_ROW or SQLITE_DONE.  I am seeing a different result after executing a DELE

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Simon Davies
2009/4/3 Sylvain Pointeau : > re-hi, > but how do we do if we are on unix and there is some CR on those field? > I cannot insert CR in my statement (only line feed) > > do you have any suggestion? > > Cheers, > Sylvain > Something like this: SQLite version 3.4.2 Enter ".help" for instructions sql

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Sylvain Pointeau
re-hi, but how do we do if we are on unix and there is some CR on those field? I cannot insert CR in my statement (only line feed) do you have any suggestion? Cheers, Sylvain On Fri, Apr 3, 2009 at 2:15 PM, Sylvain Pointeau wrote: > Hi, > thank you very much for your answers, > > I didn't thin

Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Emil Obermayr
On Thu, Apr 02, 2009 at 08:20:38PM -0700, Dave Brown wrote: > Our software often runs into problems when run on USB keys. Specifically, > calls to sqlite to read/write to the database hang infinitely, or return Does it work on harddisk? I can tell RO-access works nicely on Windows XP. Do you hav

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Sylvain Pointeau
Hi, thank you very much for your answers, I didn't think to put the real line feed into my shell script command line. Cheers, Sylvain On Fri, Apr 3, 2009 at 1:35 PM, Emil Obermayr wrote: > On Fri, Apr 03, 2009 at 12:25:18PM +0200, Sylvain Pointeau wrote: > > > > How do I specify the character

Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Jean-Denis Muys
On 4/3/09 5:20 AM, "Dave Brown" wrote: > Our software often runs into problems when run on USB keys. Specifically, > calls to sqlite to read/write to the database hang infinitely, or return > SQLITE_BUSY after even 10 seconds of waiting. The problem seems to be that > the database file gets locke

[sqlite] Problems with file locks on USB keys

2009-04-03 Thread Dave Brown
Our software often runs into problems when run on USB keys. Specifically, calls to sqlite to read/write to the database hang infinitely, or return SQLITE_BUSY after even 10 seconds of waiting. The problem seems to be that the database file gets locked and remains locked, presumably by some problem

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Emil Obermayr
On Fri, Apr 03, 2009 at 12:25:18PM +0200, Sylvain Pointeau wrote: > > How do I specify the character "line feed" (\n) > in my query? Depends a little on your wrapper (outer) programming language. A technic that works in most language is to fill a variable with the code of LF and then use this va

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Igor Tandetnik
"Sylvain Pointeau" wrote in message news:af5c8a920904030325w631f8dfcu90f5f80266f57...@mail.gmail.com > I have some line feed in one field in my table > and I would like to replace this line feed by a space. > > How do I specify the character "line feed" (\n) > in my query? > > ex: select * from my

[sqlite] select with a like containing a line feed

2009-04-03 Thread Sylvain Pointeau
Hello, I have some line feed in one field in my table and I would like to replace this line feed by a space. How do I specify the character "line feed" (\n) in my query? ex: select * from mytable where myfield like '%\n%' of course \n doesn't work. many thanks in advance for your help. Cheers,

Re: [sqlite] Simple example for dummy user writing C code

2009-04-03 Thread Simon Davies
2009/4/3 My Name : > I don't quite understand blobs yet so help is needed... > > Here's my database: > > CREATE TABLE foo > ( >  a  INT, >  b  TEXT, >  c  BLOB > ); > > int write_foo(int a, char *b, void *c, size_t len) > { >  int i; >  char cmd[1024]; >  sqlite3_stmt *stmt; > >  sprintf(cmd, "UPDA

Re: [sqlite] Simple example for dummy user writing C code

2009-04-03 Thread My Name
I don't quite understand blobs yet so help is needed... Here's my database: CREATE TABLE foo ( a INT, b TEXT, c BLOB ); int write_foo(int a, char *b, void *c, size_t len) { int i; char cmd[1024]; sqlite3_stmt *stmt; sprintf(cmd, "UPDATE foo SET c=? WHERE a=%d AND b='%s';", a, b);