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

When you have to use a default "rollback to" savepoint of plvlog?

717


Write a query to display the current date in sql?

511


Can we join same table in sql?

523


What is the sql*loader? : aql loader

585


Is sql difficult?

743






How to find 3rd highest salary of an employee from the employee table in sql?

565


What is fmtonly in sql?

527


How do I debug a stored procedure?

625


What are the different types of triggers?

589


what are the advantages and disadvantages of views in a database? : Sql dba

529


What is a database trigger?

612


What is nested table in pl sql?

551


What are the disadvantages of not performing database normalization?

593


What is sql profiling in oracle?

543


What is scalar data type in pl sql?

549