I'm looking for some help with removing double and single quotations from a description field in one of the tables in my SQLBase database. I'm using version 8.1.0 which is an older version of SQLBase and in looking at the language reference I'm thinking that I'll need to use some combination of the @REPLACE and @FIND function to accomplish this but I'm not quite finding the correct combination of syntax to accomplish this. Just so I'm clear on what I am trying to accomplish, I just want to replace the single and double quotes with a blank space and leave the rest of the description in place. The statements that I've been working on using the SQLConsole are as follows:
update part set description = @REPLACE(description, @FIND('\"',description,0), 1, ' ') WHERE description like '%\"';
update part set description = @REPLACE(description, @FIND('\'',description,0), 1, ' ') WHERE description like '%''';
I'm hoping this is possible using the SQLConsole because otherwise I'm faced with trying to edit the filed manually.
One additional caveat is that some of the descriptions may contain two or more double or single quotes.
Thanks for any help anyone might provide.
update part set description = @REPLACE(description, @FIND('\"',description,0), 1, ' ') WHERE description like '%\"%';
To replace multiple occurences you have to (re)start the script as long as the number of updated rows is greater than 0.
Before update description was LOOM MOUNTING CLIP 1/2"
After update description was OOM MOUNTING CLIP 1/2"
Thanks for giving this a look.
Update BETRAN Set BETRAN_ID = @REPLACE(BETRAN_ID, @FIND(' ', BETRAN_ID, 0), 1, '-') Where BETRAN_ID Like '% %';
As you can see we replaced spaces with minus characters. And this does work!
Who is online
Users browsing this forum: [Ccbot] and 0 guests