Re: VARCHAR2 Length

From: Tim X <>
Date: Thu, 10 Dec 2009 17:57:22 +1100
Message-ID: <>

The Magnet <> writes:

> On Dec 9, 10:24 am, The Magnet <> wrote:
>> So, the max length of VARCHAR2 is 4000 bytes.  So, in PL/SQL, if you
>> need to declare a variable longer than 4000, what can you use?  We
>> need to declare a variable and continue to concatenate strings onto it
>> and it becomes longer than 4000 bytes, so, we're SOL?
>> Still looking for the answer on other sites.
> Of course I should have said more: What we need to do is put together
> a dynamic query and open up a cursor:
> v_select := 'blah blah blah....'
> open p_data for v_select;
> v_select is longer than 4000 bytes.

limit of varchar2 is 4k for database columns limit of varchar2 for pl/sql is 32k

Note that I also think dynamic sql is limited to 32k unless you use the dbms_sql package (but verify this against the Oracle version your using as I could be wrong).


tcross (at) rapttech dot com dot au
Received on Thu Dec 10 2009 - 00:57:22 CST

Original text of this message