Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread wqual
Hi Jay, list. Many thanks for your comments. In many cases, exporting the table as a textfile and using sed to search and replace will be a very good solution. Thanks! But Jay: how can I implement a function "MyFunction" like in your example? Could you give me a hint? That would be really great!

[sqlite] Grabbing "default values" from the database...

2006-08-08 Thread Gordon Ellsworth
I'm working on a project in C# that uses an SQLite database back-end. I have a table set up so that some columns have default values, such as: CREATE TABLE mc_question (id integer primary key autoincrement, q_type varchar(5) default "MC", single_multi bool, negative_score bool, cumulative_all bo

Re: [sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread vidushi tandon
i Want to Unsubscribe my Account from SQLite --- Kurt Welgehausen <[EMAIL PROTECTED]> wrote: > "Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > > > RohitPatel > > > wrote: > > > Scenario 1 > > > If action of some user needs to execute multiple > SELECT statements > > > (read-only, no plan to

Re: [sqlite] C precompiler to bytecode

2006-08-08 Thread Joe Wilson
--- Bill KING <[EMAIL PROTECTED]> wrote: > Daniel Önnerby wrote: > > Hi everyone! > > > > I'm just a bit curios if it would be possible to make like a C > > precompiler or a macro of some kind that compiles/interpret the > > SQL-statements to bytecode just like the sqlite_prepare does but does > >

Re: [sqlite] [ANN]SQLtNoCase - convert SQLite TEXT columns to TEXT COLLATE NOCASE

2006-08-08 Thread Me
Probably. Then again, it's was done. - Original Message - I don't mind receiving occasional announcements on new programs using SQLite (even if I'll never use them), but don't you think one per day is just too much? Regards, ~Nuno Lucas

Re: [sqlite] UNICODE Support

2006-08-08 Thread Jens Miltner
Am 04.08.2006 um 19:23 schrieb Cory Nelson: I was not talking about sorting in my post - I've had simple = index comparisons fail in UTF-8. I'm pretty sure you can get the same kind of 'failure' when using UTF-16, e.g. when comparing decomposed against composed forms of unicode strings. S

Re: [sqlite] random access table row

2006-08-08 Thread Jens Miltner
Am 08.08.2006 um 13:15 schrieb Lijia Jin: Hi, I am new to sqlite and need some help for random accessing a table row using Sqlite C API. The project I am working on supports network users to query the sqlite database from remote sites. We like to provide an interface so that user can acc

Re: [sqlite] C precompiler to bytecode

2006-08-08 Thread Bill KING
Daniel Önnerby wrote: > Hi everyone! > > I'm just a bit curios if it would be possible to make like a C > precompiler or a macro of some kind that compiles/interpret the > SQL-statements to bytecode just like the sqlite_prepare does but does > this when compiling/precompiling your application inste

Re: [sqlite] C precompiler to bytecode

2006-08-08 Thread Nuno Lucas
On 8/8/06, Daniel Önnerby <[EMAIL PROTECTED]> wrote: I'm just a bit curios if it would be possible to make like a C precompiler or a macro of some kind that compiles/interpret the SQL-statements to bytecode just like the sqlite_prepare does but does this when compiling/precompiling your applicati

Re: [sqlite] C precompiler to bytecode

2006-08-08 Thread Cesar David Rodas Maldonado
That's a very good idea!, and I would like to help for do that On 8/8/06, Daniel Önnerby <[EMAIL PROTECTED]> wrote: Hi everyone! I'm just a bit curios if it would be possible to make like a C precompiler or a macro of some kind that compiles/interpret the SQL-statements to bytecode just like t

[sqlite] C precompiler to bytecode

2006-08-08 Thread Daniel Önnerby
Hi everyone! I'm just a bit curios if it would be possible to make like a C precompiler or a macro of some kind that compiles/interpret the SQL-statements to bytecode just like the sqlite_prepare does but does this when compiling/precompiling your application instead of at runtime. Since most

Re: [sqlite] [ANN]SQLtNoCase - convert SQLite TEXT columns to TEXT COLLATE NOCASE

2006-08-08 Thread Nuno Lucas
I don't mind receiving occasional announcements on new programs using SQLite (even if I'll never use them), but don't you think one per day is just too much? Regards, ~Nuno Lucas On 8/8/06, Me <[EMAIL PROTECTED]> wrote: FREE - SQLtNoCase - convert TEXT columns to TEXT COLLATE NOCASE SQLite h

[sqlite] [ANN]SQLtNoCase - convert SQLite TEXT columns to TEXT COLLATE NOCASE

2006-08-08 Thread Me
FREE - SQLtNoCase - convert TEXT columns to TEXT COLLATE NOCASE SQLite handles text columns different, depending on how COLLATE is defined when the column is created. The default is COLLATE BINARY. TEXT or TEXT COLLATE BINARY - columns will be treated case sensitive for ORDER BY and WHERE com

[sqlite] wxgrid with sqlite data

2006-08-08 Thread Stefan de Konink
I wondered if anyone ever tryed sqlite as backend for a wxWidgets grid, from what I understand of the standard interface it would involve a per cell query or a smart cache. If anyone did something with wxPython/pysqlite I would like to get some advice on the subject. Stefan de Konink

Re: [sqlite] random access table row

2006-08-08 Thread Jay Sprenkle
On 8/8/06, Lijia Jin <[EMAIL PROTECTED]> wrote: select string from string where ... limit 1 offset ? ; and replace this offset value with the row number user supplied. This solution can work but it requires modifying the SQL query and calling sqlite3_reset for each get-row request. This works

Re: [sqlite] Insert from select statement - Weird behavior

2006-08-08 Thread Sandeep Suresh
Thanks for the reply Richard... I"ll try this ! -Sandeep [EMAIL PROTECTED] wrote: Sandeep Suresh <[EMAIL PROTECTED]> wrote: Hi all, The problem is for one of the columns that have values ( 8209454, 1254234, 1245663 ) in db_old, the values in the new database are changed to ( 8209454.

[sqlite] random access table row

2006-08-08 Thread Lijia Jin
Hi, I am new to sqlite and need some help for random accessing a table row using Sqlite C API. The project I am working on supports network users to query the sqlite database from remote sites. We like to provide an interface so that user can access any row in a result table without going throug

[sqlite] Re: Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread Igor Tandetnik
RohitPatel wrote: As I understand, it means after issuing BEGIN IMMIDIATE for read-only SELECT(s), no other process can do BEGIN IMMIDIATE even if its for read-only purpose. Even new reader will be blocked if it tries to do BEGIN IMMEDIATE. Right. Readers aren't supposed to do BEGIN IMMEDI

Re: [sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Thanks for the answer and clarification. > BEGIN IMMEDIATE blocks writers, not readers. I think, BEGIN IMMEDIATE surely blocks writers. And also blocks new reader(s) if any new reader tries to do BEGIN IMMEDIATE. Is this correct ? Ref: Quote from SQLite Document (http://www.sqlite.org/lang_

Re: [sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Thanks a lot for the answers. Still I have a doubt (and a question). Quote from SQLite Document (http://www.sqlite.org/lang_transaction.html) "After a BEGIN IMMEDIATE, you are guaranteed that no other thread or process will be able to write to the database or do a BEGIN IMMEDIATE or BEGIN EXCL

Re: [sqlite] Insert from select statement - Weird behavior

2006-08-08 Thread drh
Sandeep Suresh <[EMAIL PROTECTED]> wrote: > Hi all, > > The problem is for one of the columns that have values ( 8209454, > 1254234, 1245663 ) in db_old, the values in the new database are changed > to ( 8209454.001, 1254234.001 , 1245663.001 ). This column > is not defined as 'pri

[sqlite] Insert from select statement - Weird behavior

2006-08-08 Thread Sandeep Suresh
Hi all, To give a brief context : I'm trying to perform an upgrade from db_old to db_new. db_old and db_new have almost the same tables with a few modified columns. Steps to reproduce the issue : 1. Opened database file db_new 2. Attached database file db_old as 'db1' 3. Perform insert int

[sqlite] Re: Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread Igor Tandetnik
Kurt Welgehausen <[EMAIL PROTECTED]> wrote: "Igor Tandetnik" <[EMAIL PROTECTED]> wrote: RohitPatel wrote: Scenario 1 If action of some user needs to execute multiple SELECT statements (read-only, no plan to write), it needs to start explicit transaction to get consistent reads across read

[sqlite] Re: correlated subqueries

2006-08-08 Thread Igor Tandetnik
Greg Wilson <[EMAIL PROTECTED]> wrote: -- Try to update the final table in place update Result set AffilId = ( select Places.Ident from Places, People, Result where (People.Ident = Result.Ident) and (People.Affil = Places.Name) ); Yours is not a correlated subquery: it uses its own refere

[sqlite] correlated subqueries

2006-08-08 Thread Greg Wilson
Hi, I'm refactoring a small database to remove some redundancy in the original design. As part of this, I'm trying to update the values in a table using a correlated subquery, but can't get it to work with SQLite. Here's what I'm doing: -- Create the 'People' table, and show its contents create

Re: [sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread Kurt Welgehausen
"Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > RohitPatel > wrote: > > Scenario 1 > > If action of some user needs to execute multiple SELECT statements > > (read-only, no plan to write), it needs to start explicit transaction > > to get consistent reads across read-only multiple statements. >

Re: [sqlite] unsupported file format

2006-08-08 Thread Craig Morrison
Py Olivier wrote: Hello, After compiling I'm testing the C example program provided in the quick start page, just to get into the C/C++ interface for SQLite. ./exprog testdb 'select * from tbl1' The database file opens normaly, but I get an error coming from the sqlite3_exec method : SQL error

[sqlite] unsupported file format

2006-08-08 Thread Py Olivier
Hello, After compiling I'm testing the C example program provided in the quick start page, just to get into the C/C++ interface for SQLite. ./exprog testdb 'select * from tbl1' The database file opens normaly, but I get an error coming from the sqlite3_exec method : SQL error: unsupported file

Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread Jay Sprenkle
On 8/8/06, Olaf Beckman Lapré <[EMAIL PROTECTED]> wrote: How would this compare to the performance of simply (progammatically) doing an UPDATE and changing the values in a callback hook. If this is impossbile than even a SELECT with a callback where one does an UPDATE for each returned row would

Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread Olaf Beckman Lapré
How would this compare to the performance of simply (progammatically) doing an UPDATE and changing the values in a callback hook. If this is impossbile than even a SELECT with a callback where one does an UPDATE for each returned row would be possible. Olaf - Original Message - From: "J

RE: [sqlite] Recovery tool ?

2006-08-08 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
> What OS are you using? Linux 2.6.15-23-server #1 SMP Tue May 23 15:10:35 UTC 2006 i686 GNU/Linux It's an ubuntu 6.06 server distribution. > What kind of mass storage? (Disk or flash?) It's just the disk of the computer on which I installed sqlite, I don't use any mass storage device. The pot

Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread Jay Sprenkle
On 8/8/06, wqual <[EMAIL PROTECTED]> wrote: Hi Donald, thanks for this valuable comment. Regarding the regexp-function, I am not really sure whether I understood it entirely or not: is it correct that I can use the regexp *only* in external programs (e.g. a perl programme), but not on the sqlite

RE: [sqlite] Recovery tool ?

2006-08-08 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
I have identified the only table which is corrupted. > 2) See if the "vacuum" command will run, and if all tables remain afterwards. > http://www.sqlite.org/lang_vacuum.html It does not work, I have the same message: SQL error: database disk image is malformed > 3) Try a ".dump"

Re: [sqlite] Recovery tool ?

2006-08-08 Thread drh
"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTECTED]> wrote: > Sorry, I meant a power failure, or a power loss if you prefer. No worries. I got to learn a new French word! > > I have generated a new data file, this is not a problem in a development = > environment, but what should I

RE: [sqlite] Recovery tool ?

2006-08-08 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Ok, I'll try those steps and I keep you informed. -Message d'origine- De : Griggs, Donald [mailto:[EMAIL PROTECTED] Envoyé : mardi 8 août 2006 14:54 À : sqlite-users@sqlite.org Objet : RE: [sqlite] Recovery tool ? "...alimentation interruption..." --- Power interruption -- fascinating

RE: [sqlite] Recovery tool ?

2006-08-08 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Sorry, I meant a power failure, or a power loss if you prefer. I have generated a new data file, this is not a problem in a development environment, but what should I do in a production environment ? Thanks -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : m

RE: [sqlite] Recovery tool ?

2006-08-08 Thread Griggs, Donald
"...alimentation interruption..." --- Power interruption -- fascinating how languages work! Yohann, Sqlite tends to be pretty good in the face of power interruptions on most OS's, sorry you are having trouble. I think you'll want to: 1) copy your database in its current state (for safekeeping

Re: [sqlite] Recovery tool ?

2006-08-08 Thread C.Peachment
Alimentation is the French word and alimentacion is the Spanish word for "food" or "feed". In this case the poster is referring to an electrical power failure on the computer. On Tue, 08 Aug 2006 11:38:09 +, [EMAIL PROTECTED] wrote: >"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTE

[sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread Igor Tandetnik
RohitPatel wrote: Scenario 1 If action of some user needs to execute multiple SELECT statements (read-only, no plan to write), it needs to start explicit transaction to get consistent reads across read-only multiple statements. Q1. Which one is preferable -> BEGIN TRANSACTION or BEGIN IMM

Re: [sqlite] Recovery tool ?

2006-08-08 Thread drh
"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTECTED]> wrote: > Hello, > > I had an alimentation interruption on my sqlite database running on > linux. And now the data file seems to be corrupted. Is there any tool to > cleanup this file ? Or is it necessary to restart from a blank new d

[sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Hi All, While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. Scenario 1 If action of some user needs to execute multiple SELECT statements (read-only, no plan to write), it needs to start expli

Re: [sqlite] About Triggers

2006-08-08 Thread Roberto
On 07/08/06, chetana bhargav <[EMAIL PROTECTED]> wrote: Can you elobarate more on this. ( For me if two threads register for the same trigger condition, with different callback functions, do both the functions get called) The short answer to your question is no. (But I could be wrong) If I

RE: [sqlite] Problems opening db in win9x and utf8 filename

2006-08-08 Thread Costas Stergiou
> > Irony aside, you wouldn't believe how many systems claiming to be i18n > aware fail miserably when handling other than Latin-1 charsets > (especially in filenames). > > If Costas can provide a patch, I think it'd be a useful addition to > the SQLite's Win32 file handling. I'm not sure that op

[sqlite] Recovery tool ?

2006-08-08 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Hello, I had an alimentation interruption on my sqlite database running on linux. And now the data file seems to be corrupted. Is there any tool to cleanup this file ? Or is it necessary to restart from a blank new data file ? Thank you, yohann

Re: [sqlite] Problems opening db in win9x and utf8 filename

2006-08-08 Thread Peter Cunderlik
On 8/8/06, John Stanton <[EMAIL PROTECTED]> wrote: Our Sqlite applications work not only on Win98 and Win2000 but also on Linux, AIX and Solaris. Where did we go wrong? Irony aside, you wouldn't believe how many systems claiming to be i18n aware fail miserably when handling other than Latin-1

Re: [sqlite] Problems opening db in win9x and utf8 filename

2006-08-08 Thread John Stanton
Obviously one has to have file names which do not clash with the rules of the underlying file system. If you need to map a name to suit the OS you can detect the Windows OS version in your application and enforce compatibility by having a lookup table or by mangling. As the old saying goes "I

RE: [sqlite] Problems opening db in win9x and utf8 filename

2006-08-08 Thread Costas Stergiou
Hi John, Have you tried to use sqlite3_open with a path that contains non-ascii chars and make it work at the same time in Win9x and win2K? The 2 apps I mentioned before (sqLiteExplorer and SQLiteSpy) both fail the above test (and for a good reason) Costas P.S. As I said, you can make an app work

Re: [sqlite] Problems opening db in win9x and utf8 filename

2006-08-08 Thread John Stanton
Our Sqlite applications work not only on Win98 and Win2000 but also on Linux, AIX and Solaris. Where did we go wrong? Costas Stergiou wrote: Hi all, I saw no more comments on this suggestion. It is very simple to program around this issue in user code, but I would like to see it fixed in the l

RE: [sqlite] Problems opening db in win9x and utf8 filename

2006-08-08 Thread Costas Stergiou
Hi all, I saw no more comments on this suggestion. It is very simple to program around this issue in user code, but I would like to see it fixed in the library level. Unless someone has made this work-around in his code, an application cannot work at the same time in Win9x and Win2k if there is any

Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread wqual
Hi Donald, thanks for this valuable comment. Regarding the regexp-function, I am not really sure whether I understood it entirely or not: is it correct that I can use the regexp *only* in external programs (e.g. a perl programme), but not on the sqlite command line? There is no possibility to ac