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

What are data types in pl sql?

779


How do sql databases work?

710


define sql delete statement ? : Sql dba

745


What is server name sql?

801


Can pl sql procedure have a return statement?

722






What are sql objects?

736


Is sql easier than java?

734


What is difference between sql function and stored procedure?

679


Explain what is table in a database?

782


Explain the working of foreign key?

724


Can we use two order by clause in query?

738


What are all the different normalization?

744


What does select count (*) mean in sql?

737


What does bitemporal mean?

761


What are the types of subqueries?

766