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

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 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 through

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 sandersonforens...@gmail.com

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 bmburst...@gmail.com 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 trouble with.

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 J T
Dominique, Why not get a column count (datareader.fieldcount (C#) or cursor.getColumnCount() (Java/Android))? From there you should be able to simply do a try { str = getString(columnIndex); checkValue(str); } catch(Exception e) { // wasn't a string or the check (and replace)

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] database is locked for SQLITE_BUSY

2014-12-04 Thread Jonathan Moules
Thanks for the comments. I appreciate there are nuances of their differences that are likely obvious to a developer during development based on the current phrasing, but I'm putting this forward from a user's perspective. Depending on the application, an end user likely won't see the error

Re: [sqlite] database is locked for SQLITE_BUSY

2014-12-04 Thread Simon Slavin
On 4 Dec 2014, at 5:36pm, Jonathan Moules j.mou...@hrwallingford.com wrote: Depending on the application, an end user likely won't see the error code, but instead just the error message SQlite is not a program. It's an API, intended for use by a programmer. Those error codes should not

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 get

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 bmburst...@gmail.com wrote: Is it possible to somehow search for/replace a string in all columns of all tables? .dump | sed ’s/old/new/g' | .read ?

Re: [sqlite] Search for text in all tables

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