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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Substring a long in SQL ?

Re: Substring a long in SQL ?

From: Jeff Smith <jsmit234_at_ford.com>
Date: Fri, 18 Oct 2002 08:29:02 -0400
Message-ID: <aoouqe$o0n2@eccws12.dearborn.ford.com>


But you can pass the long to an in-line function in your sql statement that will return it:

FUNCTION FNGETLONGSUBSTR( ....... ) v_Long LONG;

v_nChars NUMBER;

BEGIN v_nChars := 50;

SELECT long_col INTO v_Long
FROM table
WHERE x = y
v_Desc := SUBSTR(LONG_COL,1, v_nChars ) || '...';

RETURN(v_Desc);

SELECT FNGETLONGSUBSTR( LONGCOL ) AS LONGSUBSTR, COL2, COL3..... FROM TABLE "Phil Randolph" <Phil_Randolph_at_yahoo.com> wrote in message news:c5c8fdf1.0210171416.4e9fd6d_at_posting.google.com...
> Is there any way to extract the first 1000 characters from a field of
> type long using straight SQL ?
>
> Thanks,
> Phil
Received on Fri Oct 18 2002 - 07:29:02 CDT

Original text of this message

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