Re: [sqlite] Search for text in all tables

2014-12-05 Thread Max Vlasov
>> I once implemented a virtual table "allvalues" that outputs all >> database values with (hope self-explaining) fields >> >> TableName, TableRowId, FieldName, Value > > Could you expand on how you coped with the underlying database > changing, and how you mapped virtual table rowids to the

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/05/2014 01:24 AM, Max Vlasov wrote: > I once implemented a virtual table "allvalues" that outputs all > database values with (hope self-explaining) fields > > TableName, TableRowId, FieldName, Value Could you expand on how you coped with the

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Dominique Devienne
On Fri, Dec 5, 2014 at 10:24 AM, Max Vlasov wrote: > Not particularity the answer to your question, but rather a method you > or others might use. > I once implemented a virtual table "allvalues" that outputs all > database values with (hope self-explaining) fields > >

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Max Vlasov
On Thu, Dec 4, 2014 at 10:44 AM, Baruch Burstein wrote: > > Is it possible to somehow search for/replace a string in all columns of all > tables? > Not particularity the answer to your question, but rather a method you or others might use. I once implemented a virtual table

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Petite Abeille
> On Dec 4, 2014, at 10:26 PM, Roger Binns wrote: > > That will only work under the simplest of cases. Simplicity first and foremost. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/04/2014 11:59 AM, Petite Abeille wrote: >> On Dec 4, 2014, at 8:44 AM, Baruch Burstein >> wrote: >> >> Is it possible to somehow search for/replace a string in all >> columns of all tables? > > .dump | sed ’s/old/new/g'

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/2014 11:44 PM, Baruch Burstein wrote: > Is it possible to somehow search for/replace a string in all > columns of all tables? (Disclosure: I am the APSW author) The APSW shell includes a .find command that does the searching bit. You also

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Paul Sanderson
Had 5 mins waiting for a conference call so knocked this bit of Python up. No debugging, comments or testing (other than one run on a test db) import sqlite3 import tkinter import tkinter.filedialog root = tkinter.Tk() root.withdraw() fileName = tkinter.filedialog.askopenfilename(parent=root,

Re: [sqlite] Search for text in all tables

2014-12-04 Thread J T
ace) failed // you may want to catch different exceptions } -Original Message- From: Dominique Devienne <ddevie...@gmail.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Thu, Dec 4, 2014 6:57 am Subject: Re: [sqlite] Search for tex

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Paul Sanderson
As above I use pragma table_info tablename then you can loop through each row and check the type column to see if it is text Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Dominique Devienne
On Thu, Dec 4, 2014 at 11:45 AM, Baruch Burstein wrote: > On Thu, Dec 4, 2014 at 12:18 PM, Paul Sanderson < > > If you are a coder then it is a relatively straight forward process > > Loop through each table > >Loop through each column > > This is the part I am having

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Martin Engelschalk
Hi Baruch, in such cases I do a sqlite3_prepare_v2 on "select * from mytable LIMIT 1" and get the column names using sqlite3_column_count and sqlite3_column_name. Martin Am 04.12.2014 11:45, schrieb Baruch Burstein: On Thu, Dec 4, 2014 at 12:18 PM, Paul Sanderson <

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Baruch Burstein
On Thu, Dec 4, 2014 at 12:18 PM, Paul Sanderson < sandersonforens...@gmail.com> wrote: > If you are a coder then it is a relatively straight forward process > along the lines of > > Loop through each table >Loop through each column > This is the part I am having trouble with. I can loop

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Paul Sanderson
Hi Baruch I have a commercial tool that can do the search all tables bit but not the replacing :) (not usually required by my clients - although I may add it) If you are a coder then it is a relatively straight forward process along the lines of Loop through each table Loop through each

Re: [sqlite] Search for text in all tables

2014-12-04 Thread Martin Engelschalk
Hi Baruch, no, not with SQL as I know it. Perhaps you can .dump and .output the database to a text file using sqlite3 command shell, replace your text and then create the database from the SQL using .read. HTH Martin Am 04.12.2014 08:44, schrieb Baruch Burstein: Hi, Is it possible to

[sqlite] Search for text in all tables

2014-12-03 Thread Baruch Burstein
Hi, Is it possible to somehow search for/replace a string in all columns of all tables? Thanks -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org