Re: How can i extract (substr(field,1,200) ) a substring on a long or long raw field

From: Rod Corderey <Lane_Associates_at_compuserve.com>
Date: Tue, 28 Apr 1998 09:35:49 +0100
Message-ID: <354594E5.4AF7050C_at_compuserve.com>


Hi James,

Actually you can.

In PLSQL you can fetch a long column into a varchar2 as long as you are able to be sure that the length of data in the long column will not exceed the maximum length of the varchar2 as constrained by the version.

eg 7.3 plsql max varchar2 = 32k.

Having got the data into a varchar2 you can then perform a substr in the PLSQL code.

If there is a possibility of data in excess of 32k, then you could trap the error and simply report on the number of rows that exceeded. However, the retrieval in that scenario woiuld have to be individual selects rather than a cursor set.  

Given that Long columns in previous Oracle versions had maximum lengths of 16K rising to 32k, then it is not unusual for the data content to be less than 32k.

regards

Rod Corderey

Lane Associates
Lane_Associates_at_Compuserve.com
http://www.Lane-Associates.com  

James wrote:
>
> Arie Zevenbergen <aa.zevenbergen_at_consunet.nl> wrote:
> : fetch cur into var1;
>
> That would be nice, wouldn't it? If LONG could be fetched into a VARCHAR.
>
> We can dream, can't we? :-)
> --
> James Preston, 4th Year Comp. Sci and Sys. Eng. RMIT, waiting for Godot.
Received on Tue Apr 28 1998 - 10:35:49 CEST

Original text of this message