addslashes
Fairlight
fairlite at fairlite.com
Wed Aug 25 16:42:05 PDT 2010
At Wed, Aug 25, 2010 at 06:58:02PM -0400 or thereabouts,
suspect Jose Lerebours was observed uttering:
> On Wed, Aug 25, 2010 at 4:39 PM, richard <richard at appgrp.net> wrote:
> >
> > Is there a simple way in filepro to turn "Robert's golf clubs" into
> > "Robert\'s golf clubs"?
>
> You could try using replace() function or simply write a routine that
> seeks out these characters, splits the string and escapes the
> characters.
Is REPLACE() a new function in 5.0 or 5.6? It's not in the 4.8 docs.
Personally, I'd loop through the string with INSTR(), take everything
before the offending character and put it in an uncast variable, put the
requisite escape character for the offending character, then the offending
character itself onto the new buffer, and then start from the character
after that with INSTR() on the original string. Rinse, repeat until done.
> One thing comes to mind, you may truncate some of the field content by
> inserting escape characters ...
Use an uncast dummy as the repository. The contents won't be truncated
unless they exceed (32KB - 1 byte), which is longer than any real field
you'd input into anyway. SQL won't have anything truncated, as the escape
isn't going to be stored.
> There might be a way to simply dump the content to a text file, run a
> shell script to do a global search and replace and read back the final
> output.
s/might be/is/
[Now there's irony for you...] :)
It's called sed.
mark->
--
Audio panton, cogito singularis,
More information about the Filepro-list
mailing list