Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Converitng LONG to CHAR

Re: Converitng LONG to CHAR

From: Robert W. Stanford <stanford_at_cableone.net>
Date: 2000/03/07
Message-ID: <38C51A97.77D81081@cableone.net>#1/1

what's the url to thomas's homepage?

fumi wrote:

> Franz Mueller <nospam#####franz.mueller_at_orbis.de> wrote in message
> news:38c139bc.159449_at_news.salink.net...
> > Hi,
> >
> > I eould like to convert a LONG to a char field. In the newsgroup I
> > found the following sp:
> >
> > CREATE OR REPLACE Function Long2Char(lngVal IN long) RETURN VARCHAR2
> > IS lngResult
> > VARCHAR2(2000);
> > Begin
> > lngResult := lngVal;
> > Return (lngResult);
> > End;
> > /
> >
> > This compiles without any problem but if I try to access it:
> >
> > SQL> select long2char(long_field) from my_table;
> >
> > I get: ORA-00997: illegal use of LONG datatype
> >
> > What can I do?
>
> This function can only be used in PL/SQL, not in SQL.
> That's why the complier didn't return any error messages.
> LONG datatype can not be used in the parameters of functions in SQL.
> That's why ORA-997 occured.
>
> But, this function is useless, since VARCHAR2 and LONG datatype are
> almost the same in PL/SQL.
>
> You can find the answer in Thomas Kyte's home page.
Received on Tue Mar 07 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US