Home »
PL/SQL MCQs
What is the difference between Local & Global Variables?
16. What is the difference between Local & Global Variables?
- Variables in an outer block are defined as local variables since they cannot be accessed from the outside whereas the innermost block declares global variables.
- Variables in an inner block are defined as global variables since they cannot be accessed from the outside whereas the outermost block declares local variables.
- Variables in an outer block are defined as global variables since they can be accessed from the outside and the innermost block also declares global variables.
- Variables in an inner block are defined as local variables since they cannot be accessed from the outside whereas the outermost block declares global variables.
Answer: D) Variables in an inner block are defined as local variables since they cannot be accessed from the outside whereas the outermost block declares global variables.
Explanation:
Variables in an inner block are defined as local variables since they cannot be accessed from the outside whereas the outermost block declares global variables.