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: how to declare a CLOB in a PL/SQL function?

Re: how to declare a CLOB in a PL/SQL function?

From: <markp7832_at_my-deja.com>
Date: Sat, 01 Jan 2000 04:43:24 GMT
Message-ID: <84jvrr$di9$1@nnrp1.deja.com>


In article <2Qcb4.16075$ss3.294434_at_news.rdc1.il.home.com>,   "M.A." <mabaza_at_NOSPAMhome.com> wrote:
>
>
> --Is it possible to declare a CLOB variable in a PL/SQL function in
order to
> store the contents of a non-LOB field (i.e. a VARCHAR2 field)?
>
> Some sample code would be great.
>
> Mitch Abaza
> mabaza_at_NOSPAMhome.com
>
> remove NOSPAM to reply via email
>

Yes but you do not deal with the actual log value in the variable declared in pl/sql as it is actually a pointer to the lob that you use in calls to the dbms_lob package.

declare
v_mylob blob;
begin
select lob_column into v_mylob from table_with_lobs ..... dbms_output.put_line('Size = '||dbms_lob.getlength(v_mylob)); --
end;

This is basically the example in the Application Developers Guide chaper on LOB and dbms_lob. That is the reference you need to check out for using LOB data types.

I hope this helps/
--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Dec 31 1999 - 22:43:24 CST

Original text of this message

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