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

Answers were Sorted based on User's Feedback



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

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

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

Answer / masthan

runtime only

Is This Answer Correct ?    2 Yes 1 No

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

Answer / jagadeesh

compile time enough for memory allocation

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

Can ddl statements be used in pl/sql?

0 Answers  


Why do we need cursors in pl sql?

0 Answers  


how to analyze tables with 'mysqlcheck'? : Sql dba

0 Answers  


How to run sql statements through the web interface?

0 Answers  


What is varchar used for?

0 Answers  






cursor types? explain with example programs?

1 Answers   HP,


how to delete an existing column in a table? : Sql dba

0 Answers  


what are date and time functions in mysql? : Sql dba

0 Answers  


I want to know last five transactions or records from emp table, from now?

11 Answers   Wells Fargo,


What is difference between a PROCEDURE & FUNCTION ?

6 Answers   Satyam,


What is the difference between functions, procedures, and packages in pl/sql?

0 Answers  


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?

2 Answers   HSBC,


Categories