distal-attribute
distal-attribute
distal-attribute
distal-attribute

finding & replacing

User, date Message
Written by JamieEffMoney, Euro
1 year ago
Category: General
25 posts since Wed, 09 Jan 13
Hi there

Just wondering how I would use Heidi to find multiple uses of a particular word in Data view and replace it with another word without having to manually do each one....

Many thanks

Jamie
Written by ansgar
1 year ago
4800 posts since Fri, 07 Apr 06
Normally, you would write an UPDATE query in a "Query tab".

But I'm currently working on issue #2979. When this is done, you can hit Ctrl+R for a "Search + Replace" dialog (or Ctrl+F for "Find" mode), and replace specific text in rows. This replacement is done on the rows you have either in the "Data" tab, or in a editable query result from one table. You can even apply regular expressions with callbacks there, make the search case insensitive and so on.
Written by JamieEffMoney, Euro
1 year ago
25 posts since Wed, 09 Jan 13
Sorry anse, I am really really new to all this so I dont know how to write or what to write in a query tab....

when do you think #2979 will be done?
Written by ansgar
1 year ago
4800 posts since Fri, 07 Apr 06
Will take some more days.

However, you should definitly make yourself familiar with some SQL stuff if you use HeidiSQL. The more you know about SQL, the less critical is it to click "somewhere".

The "Query" tab is the rightmost one of the main tabs. Click on it, write some SQL code into the editor and press F9 or the blue arrow button to execute it.

Look at the following query:

UPDATE mytable SET mycolumn1=REPLACE(mycolumn1, 'from_str', 'to_str')


This would modify all rows with a "from_str" literal in mycolumn1, replacing it with "to_str".

Be careful, this applies to the whole table, so this is very powerful and probably executed within a few milliseconds after having pressed F9.
Written by JamieEffMoney, Euro
1 year ago
25 posts since Wed, 09 Jan 13
thanks anse

thats a real help :D
 

Please login to leave a reply, or register at first.