Solved

Replace string function

Posted on 2004-10-11
3
3,061 Views
Last Modified: 2013-12-09
Hi

I have a table, some of the data in which is invalid. When it was loaded from an old system it came out with two spaces in between some words instead of one.

The column 'suppname' should have supplier names like 'ABC Ltd' but instead has 'ABC  Ltd' [two spaces]

How can I fix this?

0
Comment
Question by:eekj
  • 2
3 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 12279655
Hi eekj,

which udf libraries do you have installed? what version of interbase or firebird are you using?

Cheers!
0
 
LVL 3

Author Comment

by:eekj
ID: 12317996

>which udf libraries do you have installed? what version of interbase or firebird are you using?
Not sure about udfs, whatever is standard... its firebird 1.5

0
 
LVL 19

Accepted Solution

by:
NickUpson earned 500 total points
ID: 12363506
I believe the easiest solution is to write your own udf to do it or use whatever client
you are comfortable with. I can be done in sql with a series of carefully written update
statements using substrings like this,

update table set suppname = substring before 2 spaces || substring after 2 spaces where
suppname has 2 spaces in a particular location, then repeat for every possible location
but this approach is so easy to get wrong I'd go with one of my first suggestions
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Mysql vs Oracle 10 120
LanSweeper custom report generation 3 311
Mysql not caching queries 4 50
Runtime 3044 error 14 19
Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now