PL/SQL and 32K+ String Vars...

PL/SQL and 32K+ String Vars...

Post by Jaso » Thu, 11 Jan 2001 23:23:30



I have a pl/sql procedure that builds a document one line
at a time where a global buffer is used to hold the whole
document until its later inserted into long column of a
table.

For example,

 write_line(...some text string ...);

 procedure write_line(str in varchar2)
 is
  begin
   global_doc_buffer:=global_doc_buffer||str||chr(10);
  end;

Problem is that pl/sql only seems to allow me to build
a runtime global_doc_buffer of around 32K.

Isnt there a way of working with string variables in pl/sql
that are larger than 32K? I even thought of breaking it
up but when i do the insert into the long column of
the table I can't seem to append the chunks together

insert into table (document) values(doc_buffer1||doc_buffer2);

If the concantenation is longer than 32K is still dies !!!

Any ideas would be greatly appreciated...

thanks
jason

 
 
 

PL/SQL and 32K+ String Vars...

Post by Mark Wagone » Thu, 11 Jan 2001 23:41:33


Jason,

Try using a temporary CLOB (assuming you are on 8i).  These have a 4G limit.


Quote:> I have a pl/sql procedure that builds a document one line
> at a time where a global buffer is used to hold the whole
> document until its later inserted into long column of a
> table.

> For example,

>  write_line(...some text string ...);

>  procedure write_line(str in varchar2)
>  is
>   begin
>    global_doc_buffer:=global_doc_buffer||str||chr(10);
>   end;

> Problem is that pl/sql only seems to allow me to build
> a runtime global_doc_buffer of around 32K.

> Isnt there a way of working with string variables in pl/sql
> that are larger than 32K? I even thought of breaking it
> up but when i do the insert into the long column of
> the table I can't seem to append the chunks together

> insert into table (document) values(doc_buffer1||doc_buffer2);

> If the concantenation is longer than 32K is still dies !!!

> Any ideas would be greatly appreciated...

> thanks
> jason


 
 
 

1. PL-SQL & strings larger than 32K

I have 100+ char strings that I have to concatenate
and then store in a LONG database column..I am
using PL-SQL scripts to do this. Since the limit
for varchar2 and long datatype in PL-SQL is 32K,
if my combined concatenated string (PL_SQL variable)
goes about 32K i get a numeric or value error..

Any ideas to implement this

-anil

--
Anil Kamath
SmartOnline Inc. (www.smartonline.com)

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Backup + Restore to different server = screwed up IDENTITY?

3. passing data around in PL/SQL longer then 32K

4. DBA Opportunity! SQL Server / Oracle

5. SQL*LOAD 32K String

6. Oracle developers--top firm

7. Global String Size Limitation of 32K

8. a password feature needed

9. String exceeds 32K

10. Strings and Date Vars in Scripted queries

11. Query vars Vs Query string

12. PL/SQL & 32k+ string variables ???

13. SQL-92, Migrate PL/SQL at ORACLE into PL/SQL at SQL Server 7.0