size of varchar2 in pl/sql [message #240337] |
Thu, 24 May 2007 11:33  |
rolex.mp
Messages: 161 Registered: February 2007
|
Senior Member |
|
|
i came to know that maximum size of varchar2 in a program unit can be 32767 bytes .
Does it mean that the complete storage area is fixed as of char datatype or does it allocate size only to the amount which is actually stored inside the variable .
|
|
|
|
Re: size of varchar2 in pl/sql [message #240422 is a reply to message #240337] |
Thu, 24 May 2007 15:49  |
SnippetyJoe
Messages: 63 Registered: March 2007 Location: Toronto, Canada
|
Member |
|
|
Here's what the PL/SQL User's Guide says about this (see VARCHAR2 Datatype).
Quote: | "Small VARCHAR2 variables are optimized for performance, and larger ones are optimized for efficient memory use. The cutoff point is 2000 bytes. For a VARCHAR2 that is 2000 bytes or longer, PL/SQL dynamically allocates only enough memory to hold the actual value. For a VARCHAR2 variable that is shorter than 2000 bytes, PL/SQL preallocates the full declared length of the variable. For example, if you assign the same 500-byte value to a VARCHAR2(2000 BYTE) variable and to a VARCHAR2(1999 BYTE) variable, the former takes up 500 bytes and the latter takes up 1999 bytes."
|
--
Joe Fuda
SQL Snippets
|
|
|