Recuring seach and replace with a twist.

This is a discussion on Recuring seach and replace with a twist. within the MySQL Database forums, part of the Database Forums category; Hi, If I have a text with something like... "A=1 A=2 A=3 A=4" I ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2006
Simon
 
Posts: n/a
Default Recuring seach and replace with a twist.

Hi,

If I have a text with something like...

"A=1 A=2 A=3 A=4"

I want to replace all the instance of "A=num" with "B=num*num", (the square
root of the number after A)

So that in the example above

"A=1 A=2 A=3 A=4"
Would become
"B=1 B=4 B=9 B=16"

If I run a simple recurring update it does not work.

UPDATE tableA SET contentA = REPLACE (
contentA,
'A=',
'B=' );

Would of course only replace 'A=' and give me:

"B=1 B=2 B=3 B=4"

So, how can I do a recurring search and replace the value and the text after
what I am searching for?

many thanks

Simon




Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:19 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0