Re: [sqlite] Sqlite3.exe command line tool - winXP

2009-12-07 Thread Simon Slavin
On 7 Dec 2009, at 7:05am, dave lilley wrote: sqlite3 path to the DB dbfile I get put to the command line. How many bytes long is this file 'dbfile' ? typed in the following and below is the results. sqlite .show echo: off explain: on headers: on mode: explain nullvalue:

Re: [sqlite] char,ascii function in sqlite

2009-12-07 Thread Simon Slavin
On 7 Dec 2009, at 5:56am, greensparker wrote: i want to check the first character should not be an special character. [by before insert trigger] how to do it? i thought of using ascii function but i didnt find in sqlite. substr(X,Y,Z) will get you the first character. I'm not sure what

Re: [sqlite] sqlite3_exec() returns SQLITE_OK but Database showsdifferent result

2009-12-07 Thread Igor Tandetnik
souvik.da...@wipro.com wrote: I am accessing the same database from two different processes. From one of the process , I am able to create tables in runtime but when I am trying to create a table from another process in runtime on the same DB I am not able to create so. The strange part is

Re: [sqlite] SQL selecting in two related tables?

2009-12-07 Thread Tim Romano
I had responded to Jean-Denis Muys as follows: select M.title from Magazine as M join ( select distinct issn, issues from subscription ) as SubscriptionVariants on SubscriptionVariants.issn = M.issn order by M.title, SubscriptionVariants.issues But I neglected to add the issues

Re: [sqlite] sqlite3_exec() returns SQLITE_OK but Database showsdifferent result

2009-12-07 Thread Pavel Ivanov
1) You are opening a different file than the one you think you are opening. E.g. you are using a relative path to the file, and the workding directory is not what you expect it to be. 2) You are starting an explicit transaction (see BEGIN) and forgetting to commit it. 3) You are starting

Re: [sqlite] char,ascii function in sqlite

2009-12-07 Thread Pavel Ivanov
As Simon said use substr() to get first character and use cast(X'FF' as text) to convert some hexadecimal character code to symbol (in my example the code is FF = 255). But there's no way to convert character into its code, so you cannot do any arithmetics with it though you probably don't need it

Re: [sqlite] sqlite3_exec() returns SQLITE_OK but Databaseshowsdifferent result

2009-12-07 Thread souvik.datta
Hi Pavel, Thanks a lot. You are right. I missed out a sqlite3_finalize() and that prevented the commit. Regards, Souvik -Original Message- From: sqlite-users-boun...@sqlite.org on behalf of Pavel Ivanov Sent: Mon 12/7/2009 6:15 PM To: General Discussion of SQLite Database Subject: Re:

Re: [sqlite] Cache size tuning

2009-12-07 Thread Pavel Ivanov
Maybe 'pragma cache_size'? Pavel On Fri, Dec 4, 2009 at 10:05 PM, Richard Klein richard.kl...@schange.com wrote: Does SQLite provide any tools to help the developer tune the database cache size? Thanks, - Richard Klein ___ sqlite-users mailing

Re: [sqlite] char,ascii function in sqlite

2009-12-07 Thread Jean-Christophe Deschamps
hi , im using sqlite3 in debain i want to check the first character should not be an special character. [by before insert trigger] how to do it? i thought of using ascii function but i didnt find in sqlite. No such function is part of the SQLite core. But I wrote an extension offering that

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread Teg
Hello Bruce, Monday, December 7, 2009, 1:20:10 AM, you wrote: BR On Dec 6, 2009, at 6:17 PM, Jean-Christophe Deschamps wrote: I was simply replying to the OP's actual question: From what I read, it is necessary to have a programmatic interface to put images into a database. True? So,

[sqlite] Effect of VACUUM when very low on disk space

2009-12-07 Thread Nick Shaw
Hi all, I'm currently writing some code that attempts to keep an SqLite database file below a certain file size (the embedded PC it is running on has a wonderful side effect that when the disk runs out of disk space, it blue-screens Windows and you can't boot the device after that - how

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread Jean-Christophe Deschamps
What is programatically How, in any meaningful way, is this different than running a shell command (program of an extremely brief size)? I took the OP's phrasing to mean that he needed a way to do it with e.g. command-line available programs, but in any case without having to use a

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread P Kishor
On Mon, Dec 7, 2009 at 9:15 AM, Jean-Christophe Deschamps j...@q-e-d.org wrote: What is programatically How, in any meaningful way, is this different than running a shell command (program of an extremely brief size)? I took the OP's phrasing to mean that he needed a way to do it with e.g.

[sqlite] BUG: The byte order mark problem in fields with ICU collation

2009-12-07 Thread Alexey Pechnikov
Hello! The SQLite in the field with ICU collation does store the BOM in the start of string. This bahaviour produce some difficulty resolving problems. select length(name),x.name, hex(x.name) from (select distinct name from const_telephony_direction where delete_date IS NULL) as x; ...

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread Jean-Christophe Deschamps
Hi Puneet, Yes, that seems like a reasonable interpretation of the OP's question, one I also understood. One thing I don't understand though, Jean-Christophe, even though one can enter base64 encoded images into the db via the sqlite shell, how does one create the base64 encoded images? One would

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread P Kishor
On Mon, Dec 7, 2009 at 9:55 AM, Jean-Christophe Deschamps j...@q-e-d.org wrote: Hi Puneet, Yes, that seems like a reasonable interpretation of the OP's question, one I also understood. One thing I don't understand though, Jean-Christophe, even though one can enter base64 encoded images into the

Re: [sqlite] Sqlite3.exe command line tool - winXP

2009-12-07 Thread Wilson, Ronald
My mistake - I meant: sqlite .schema if sqlite is telling you that the table doesn't exist, the .schema command should tell you what tables exist. RW Ron Wilson, Engineering Project Lead (o) 434.455.6453, (m) 434.851.1612, www.harris.com HARRIS CORPORATION | RF Communications Division

[sqlite] Murmurhash2 function as new extension

2009-12-07 Thread Alexey Pechnikov
Hello! See http://mobigroup.ru/files/sqlite-ext/murmurhash/ and a few words on russian http://geomapx.blogspot.com/2009/12/murmurhash-20.html The examples: select murmurhash(1,2,3); 1074609160 sqlite select murmurhash('hello',99); 3350841100 sqlite select murmurhash('hi!',1); 2372833641 sqlite

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread Jean-Christophe Deschamps
Could you please give me a step by step on how to do that? Not via a small program written in a programming language, but only via the sqlite3 shell, as both you and I agree that was the implied intent of the OP's question. Sorry, I'm no vxWorks, Unix, Linux, MacOS, Windows, AS400, Symbian,

Re: [sqlite] Putting images into SQLite.

2009-12-07 Thread Shane Harrelson
As others have said, there are lots of ways to store the image data directly in the DB with BLOBs, encoding, etc. Alternatively, you could store the pics separate from the DB and just store the path to the pic file in the DB. -Shane On Sun, Dec 6, 2009 at 8:35 PM, Ted Rolle, Jr.

Re: [sqlite] Effect of VACUUM when very low on disk space

2009-12-07 Thread Simon Slavin
On 7 Dec 2009, at 2:27pm, Nick Shaw wrote: When the file exceeds a certain size, I DELETE a specific number of records, then VACUUM the file to get the size back below required limits. This works fine, however what happens to the VACUUM command if there is insufficient disk space for SqLite

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Igor Tandetnik
Alexey Pechnikov pechni...@mobigroup.ru wrote: The SQLite in the field with ICU collation does store the BOM in the start of string. What do you mean by SQLite stores the BOM? Are you saying that you are passing in a string without the BOM, and SQLite spontaneoulsy manufactures one?

[sqlite] SQLite version 3.6.21

2009-12-07 Thread D. Richard Hipp
SQLite version 3.6.21 is now available on the SQLite website: http://www.sqlite.org/ SQLite version 3.6.21 is a monthly maintenance release of SQLite. Upgrading from prior versions is optional. Version 3.6.21 features an enhancement to the sqltie3_trace() interface such that the values of

[sqlite] SQLite bug report - large databases only - 'database or disk is full'

2009-12-07 Thread pirx
SQLite bug report   Summary: -- error message: Error: near line 2: database or disk is full It happens with plenty of disk space available and with 'unlimited' database size. It does not happen on all systems. It does not happen on small databases.   Details: --

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Alexey Pechnikov
Hello! On Monday 07 December 2009 22:29:47 Igor Tandetnik wrote: What do you mean by SQLite stores the BOM? Are you saying that you are passing in a string without the BOM, and SQLite spontaneoulsy manufactures one? Double-check your application - I suspect you'll find that you are

[sqlite] Recipe to safely move/rename a database?

2009-12-07 Thread Chris Eich
I have a scenario where I want to move 99+% of the records from one database to another, initially empty but for a set of table definitions (in practice, copied from a template file). On my Linux platform, I find that the INSERT INTO archive.my_table SELECT * FROM my_table WHERE (...) takes

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Igor Tandetnik
Alexey Pechnikov pechni...@mobigroup.ru wrote: Yes, the BOM is on the original string. But with ICU collation we can see that 17 symbols string is equal to 16 symbols string. I think this result is not right. What's the basis for this belief? It's not at all uncommon for two Unicode strings

Re: [sqlite] Recipe to safely move/rename a database?

2009-12-07 Thread Simon Slavin
On 7 Dec 2009, at 9:58pm, Chris Eich wrote: On my Linux platform, I find that the INSERT INTO archive.my_table SELECT * FROM my_table WHERE (...) takes unreasonably long (it involves about 30MB of data). Do you have a transaction around all the INSERT commands ? This will speed it up many

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Alexey Pechnikov
Hello! On Tuesday 08 December 2009 01:07:54 Igor Tandetnik wrote: Alexey Pechnikov pechni...@mobigroup.ru wrote: Yes, the BOM is on the original string. But with ICU collation we can see that 17 symbols string is equal to 16 symbols string. I think this result is not right. What's the

Re: [sqlite] Recipe to safely move/rename a database?

2009-12-07 Thread raf
Simon Slavin wrote: On 7 Dec 2009, at 9:58pm, Chris Eich wrote: On my Linux platform, I find that the INSERT INTO archive.my_table SELECT * FROM my_table WHERE (...) takes unreasonably long (it involves about 30MB of data). Do you have a transaction around all the INSERT commands ?

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Igor Tandetnik
Alexey Pechnikov pechni...@mobigroup.ru wrote: The normalization is now performed by any string operation. But more fast and useful to do it once at data store. So, which normalization form should the data store choose for me? And what if I need a different one? I'd rather the database

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Alexey Pechnikov
Hello! On Tuesday 08 December 2009 01:35:49 Igor Tandetnik wrote: So, which normalization form should the data store choose for me? And what if I need a different one? I'd rather the database store my data exactly the way I put it in. I really don't want it to decide for me what my data

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Igor Tandetnik
Alexey Pechnikov pechni...@mobigroup.ru wrote: On Tuesday 08 December 2009 01:35:49 Igor Tandetnik wrote: So, which normalization form should the data store choose for me? And what if I need a different one? I'd rather the database store my data exactly the way I put it in. I really don't

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Nicolas Williams
On Mon, Dec 07, 2009 at 05:35:49PM -0500, Igor Tandetnik wrote: Alexey Pechnikov pechni...@mobigroup.ru wrote: The normalization is now performed by any string operation. But more fast and useful to do it once at data store. So, which normalization form should the data store choose for

Re: [sqlite] The byte order mark problem in fields with ICUcollation

2009-12-07 Thread Igor Tandetnik
Nicolas Williams nicolas.willi...@sun.com wrote: I believe the right thing to do is to normalize strings when creating index entries, but to leave the table data unnormalized. You'd have to make the equality operator also normalize though. I believe that's precisely what ICU collations do.

[sqlite] [SOLVED] How do I properly import numbers from CSV?

2009-12-07 Thread Walter Dnes
On Sun, Dec 06, 2009 at 11:26:42PM -0500, Walter Dnes wrote I still don't understand why 2009, *WITHOUT QUOTES* would be forced to text, i.e. ' 2009', when imported into a field that is declared as integer in the create statement. There are actually 2 solutions... 1) Use tab-delimited if