Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Upper, Longvarchar and RTF text
On Jun 12, 4:41 pm, Wazusa Blong <fitzjarr..._at_cox.net> wrote:
> Comments embedded.
> On Jun 12, 4:56 am,Sonnich Jensen<sonnich.jen..._at_jotautomation.com>
> wrote:
>
> > I have this: select * from blaaah and upper(somefield) like '%EPLACED
> > %'
> I'm hoping this is a typographical error and you simply missed
> pasting the WHERE clause ...
ups... yep it is there, I cutted something out
> > somefield is of type LongVarchar, and contains text in RTF format.
> > We are looking for the text "Replaced", which in most cases is "R\f1
> > eplaced".
> My guess is this is a LONG datatype, as LongVarchar does not exist as
> a type.
>
> > The upper should help us out, for both "upper" and "like" I get an
> > errors: expexted NUMBER got LONG.
> > It is a longvarchar.
> > Even select upper( the field) will cause that problem.
>
> Yes, LONG does not behave as one might expect given the data it
> contains. You'll need to convert this text to a varchar2 before you
> can use upper() or
> substr(). I would be looking into writing some PL/SQL code to do
> this. If I remember correctly asktom.oracle.com has examples of this.
You mean cast it or convert the table?
I looked at that site but did not find anything.
/S Received on Tue Jun 12 2007 - 10:59:45 CDT