Re: Oracle7 LONG vs. PL/SQL LONG

From: Ian C. Sellers <"Ian>
Date: 1997/08/05
Message-ID: <5s8776$91t_at_news-1.boco.co.gov>#1/1


I'm sorry this is not a helpful anser, but I disagree with Mark. These variable datatypes are explicitly different. A PL/SQL variable of long datatype is limited to 32760 bytes. An Oracle database column with long datatype can contain 2 gigs. If you try to insert a 2 gig Oracle long item into any pl/sql variable you will not get only the first 32k -- you will get a value_error exception. In fact, in PL/SQL, the longest datatype is VARCHAR2 at 32767 bytes.

For this reason, there is basically never any reason to use a pl/sql variable of long datatype. Varchar2 will always hold 7 bytes more.

I remember seeing a posting about a month ago in this newsgroup, including some code to allow you to retrieve parts of the long column into several variables.

Also, FMI, does power objects use something other than pl/sql to retrieve data? Why would power objects work to retrieve a long?

Respectfully,
-Ian

Mark Preston wrote:

> On Mon, 04 Aug 1997 11:52:11 -0400, Leslie_B_DreyerKalra
> <lbd_at_techiesinc.com> wrote:
>
> Check again. A LONG in pl/sql isn't any different then and "Oracle7"
> long. They are one in the same. The restriction in pl/sql is that it
> can only access the first 32767 characters of a long. So if the
> long is 2gb, you can only get to the first 32k of it via pl/sql.
> If you want to access from the web, i.e. pc, use
> power objects.
>
> Mark.
>
> >Hello all...
> >
> >I'm having some trouble getting at the data in a LONG column.
> >
> >I understand that the PL/SQL LONG is only 32760 characters long,
 while
> >the ORACLE7 LONG is 2 GB or so. Nonetheless, I have to generate a web
 

> >page with the contents of my LONG column in it. How do I get at it?
 Do I
> >have to resort to another language, or is there some way I can
 persuade
> >PL/SQL to deal with it?
> >
> >I'm using an explicit cursor in a FOR loop. I use the cursor output
 as
> >input to htp.tableData calls to generate the web page. It works fine
 as
> >long as the data in the column is <= 32760. If I push it to 32761, I
 get
> >a value_error exception.
> >
> >I will use perl (DBI) for this if I have to, but it will be much more
 

> >painful if I do. Does anyone know of a way to get around this
 limitation
> >in PL/SQL??
> >
> >Thanks much!
> >
> >Leslie
Received on Tue Aug 05 1997 - 00:00:00 CEST

Original text of this message