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
How can we optimize a sql query?
Are subqueries faster than joins?
Show code of a cursor for loop.
How to find 3rd highest salary of an employee from the employee table in sql?
Does google use sql?
What are the constraints available in sql?
Why function is used in sql?
What are all the different normalization?
what are the disadvantages of mysql? : Sql dba
What is input buffer in sql*plus?
What are the types pl/sql code blocks?
Can a commit statement be executed as part of a trigger?
what is meant by urlencode and urldocode? : Sql dba
Is left join same as inner join?
Can we rename a column in the output of sql query?