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: Substring of a LONG

Re: Substring of a LONG

From: Alan Shein <alanshein_at_erols.com>
Date: Wed, 8 Dec 1999 12:19:01 -0500
Message-ID: <82m3tt$qt5$1@autumn.news.rcn.net>


You can't do much with a LONG, including SUBSTR. Here's one way around the problem. Create another column (or table- your choice), but the idea is that the column is a VARCHAR2(100) and contains the first 100 characters of your LONG. You search on the VARCHAR2 field, but show the LONG in the result.

kev <kevin.porter_at_fast.no> wrote in message news:384E87AE.5BA55726_at_fast.no...
> Hi,
>
> I am storing stories in our database in LONG format. When I pull a few
> out to show on a web page (using PHP), I only want to pull, say, the
> first 100 characters, then make a link out of it to the story in full.
> I tried doing a substr(body,0,100) but got an "Incompatable datatypes"
> error.
> Does this mean the column 'body' must be a varchar2 to be able to do a
> substr() function in the SQL?
> How do I get round this? I don't want to retrieve the whole of each
> story body, that would be very inefficient.
>
> thanks,
>
> - Kev
>
Received on Wed Dec 08 1999 - 11:19:01 CST

Original text of this message

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