PL/SQL allocates memory for the variable's at runtime or at
compile time

Answer Posted / gaurav

For a CHAR variable, PL/SQL allocates at compile time enough memory for the maximum size.
For a VARCHAR2 variable, memory allocation depends on maximum size:
If the maximum size is less than 4,000 bytes, PL/SQL allocates at compile time enough memory for the maximum size.
If the maximum size is 4,000 bytes or more, PL/SQL allocates at run time enough memory for the actual value.

Thus, PL/SQL optimizes smaller VARCHAR2 variables for performance and larger ones for efficient memory use. ( from oracle doc)

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you get sql*loader to commit only at the end of the load file? : aql loader

556


what is the difference between sql and t-sql? : Transact sql

603


What are pl/sql cursor exceptions?

575


tell us something about heap tables. : Sql dba

605


Does inner join return duplicate rows?

521






What is difference sql and mysql?

535


What is difference between table and view?

526


What are crud methods?

553


What is %type in sql?

518


How do I add a primary key to a table?

543


what is primary key? : Sql dba

512


What are triggers and its uses?

595


What is snowflake sql?

582


What is sql constant?

509


What is %type in pl sql?

542