Re: Can you copy a long raw field in PLSQL?
Date: 1996/07/19
Message-ID: <4so556$l59_at_news.dknet.dk>#1/1
Les Phillips <lesp_at_deakin.edu.au> wrote:
>I would like to copy a record containing a long raw field.
>The field holds a word document inserted via OLE functionality
>within Forms 4.5.
>I would like to perform this within a stored procedure.
>You can create a variable of long raw in PLSQL but the data
>will be truncated if over a certain length.
>Is there a solution as to how I may achieve this?
The following is taken from a similar thread - all credit goes to the original author:
There has been a lot of discussion recently in this group on the topic of processing LONG data. The basic synopsis is that its pretty easy to process LONG data within PL/SQL as long as none of the data is longer than 32 Kb. This is because a varchar2 variable in PL/SQL may have a length of up to 32,767 bytes.
The same holds true for LONG RAW data: PL/SQL lets you declare a raw variable of up to 32,767 bytes in length. Here is a very basic example:
SQL> create table test
2 (
3 col1 long raw
4 );
Table created.
SQL> declare
2 cursor c is select col1 from test;
3 x raw(32767);
4 begin
5 open c;
6 loop
7 fetch c into x; 8 exit when c%notfound; 9 /* Do your processing here... */
10 end loop;
11 close c;
12 end;
13 /
PL/SQL procedure successfully completed.
SQL> There are certain limitations when you deal with LONG and LONG RAW data types. For example, you cannot use cursor/for loops in PL/SQL when a LONG or LONG RAW is being fetched by the cursor. But you still get a good range of functionality.
I performed the above simple test case on an Oracle 7.3.2 database (PL/SQL 2.3). However, I would expect it to work with any Oracle7 database version.
Regards,
Roger Schrag
schrag_at_ix.netcom.com
hope this helps.
Jacob
Jacob Steen Due RAMBOLL Informatics and Managementemail: jcd_at_ramboll.dk
All standard disclaimers apply and all that. Witty disclaimer under construction. Received on Fri Jul 19 1996 - 00:00:00 CEST