PL/SQL allocates memory for the variable's at runtime or at
compile time
Answers were Sorted based on User's Feedback
Answer / 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 |
Can ddl statements be used in pl/sql?
Why do we need cursors in pl sql?
how to analyze tables with 'mysqlcheck'? : Sql dba
How to run sql statements through the web interface?
What is varchar used for?
cursor types? explain with example programs?
how to delete an existing column in a table? : Sql dba
what are date and time functions in mysql? : Sql dba
I want to know last five transactions or records from emp table, from now?
What is difference between a PROCEDURE & FUNCTION ?
What is the difference between functions, procedures, and packages in pl/sql?
I have a table with 1 million records out of which 10,000 records are of unique records, then if I will implement index, then which type of index shall I use and why shall I use?