Subject | Re: [firebird-support] Getting rid of extra spaces |
---|---|
Author | David Johnson |
Post date | 2004-10-17T18:43:05Z |
You will probably want to parse and trim this out in your application.
Application languages (C, Object Pascal, Java, etc) tend to be better
suited to this sort of manipulation than stored procedure languages. If
it absolutely need to be handled in the DBMS, rather than the
application, Firebird's syntax should be up to the task.
Essentially, the algorithm is:
while not end-of-text do
begin
skip-blanks
get-next-word
append-word-to-result
if not end-of-text then
begin
append space to result
end
end
It can be implemented in most languages and fancied up a bit to handle
punctuation without changing the essentials.
Application languages (C, Object Pascal, Java, etc) tend to be better
suited to this sort of manipulation than stored procedure languages. If
it absolutely need to be handled in the DBMS, rather than the
application, Firebird's syntax should be up to the task.
Essentially, the algorithm is:
while not end-of-text do
begin
skip-blanks
get-next-word
append-word-to-result
if not end-of-text then
begin
append space to result
end
end
It can be implemented in most languages and fancied up a bit to handle
punctuation without changing the essentials.
On Sat, 2004-10-16 at 16:23, Nick Upson wrote:
>
> I want to get rid of extra spaces between words in a varchar field
>
> Can anyone reccommend a method?
>
> (BTW I posted this as a newsgroup message several hours ago and it
> has't shown up on the newsgroup, so I thought I'd send it as email
> via yahoo)
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>