Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: fixing the ' char ?
HI,
Damed strange!!
but I did fix it by changing the replace string from 255 to "$SQUOTE$"
then it works.
I suspect there may be some other translation going on between the
drivers, bcause when I looked at the char in the database it was a 192
not 255
is the routine "Acceptable" oracle programming or is there a better way.
steve
Daniel Reis <dreis_at_capgemini.fr> wrote:
> I tried this and it worked with no probs...
>
> create table a (f varchar2(100)) ;
> insert into a values ('a' || chr(255) || 'b') ;
>
> select translate( f , chr(255), chr(39) ) from a ;
>
> Or:
>
> select replace( f , chr(255), chr(39) ) from a ; (your code)
>
>
> Daniel Reis
>
>
> Steve A <spectre_at_hkstar.com> wrote in message
> news:1e2k26x.q88lqb1hmqc6uN@[192.168.2.74]...
> > Hi,
> > I have for a problem with my intersolv drivers/foxpro
> > and I cannot pass the character ' directly to oracle, since it messes up
> > the parsing of the function, in my fox pro.
> > so before passing ' I convert it to a char 255.
> >
> > Therefore i have to have the following code on the oracle side.
> > but when I look at the data in the database it character has not been
> > converted and appears as a "creature" character
> >
> > any ideas?
> > steve
> >
> >
> > ( scanstr IN VARCHAR2 )
> >
> > RETURN VARCHAR2
> >
> > -- Enter the parameters for the procedure in
> >
> > -- the brackets above. If this procedure has
> >
> > -- no parameters then delete the line
> >
> >
> >
> > -- ***************************************************
> >
> > -- *
> >
> > -- * Author steve
> >
> > -- * Creation Date 23/11/99
> >
> > -- * Comments replace value 255 with '
> >
> > -- *
> >
> > -- ***************************************************
> >
> >
> >
> > IS
> >
> > -- Enter all variables cursors and constants following
> >
> > -- this line
> >
> > fixstr VARCHAR2 ( 4000 ):= '';
> >
> > BEGIN
> >
> > --fix our passed value with the new value
> >
> > fixstr := REPLACE(scanstr, CHR(255), CHR(39));
> >
> >
> >
> > RETURN fixstr;
> >
> > EXCEPTION
> >
> > -- Enter the code to handle exception conditions
> >
> > -- following this line
> >
> > WHEN OTHERS
> >
> > THEN
> >
> > NULL;
> >
> > END;
> >
> >
Received on Thu Dec 09 1999 - 19:13:07 CST
![]() |
![]() |