Multiple choice

Suppose in the declaration section of a PL/SQL block, you create but do not initialize a NUMBER variable. What will be the initial value of the variable when the block is executed?

  1. 0

  2. NULL

  3. Depends on the scale and precision of the datatype.

  4. Without initialization, a variable cannot be used in the executable section of the block.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In PL/SQL, any variable that is declared but not initialized automatically has a NULL value, regardless of its datatype. This is a fundamental PL/SQL behavior - uninitialized variables are NULL, not 0 or any default value. Option A is incorrect because 0 is not assigned automatically. Option C is wrong because the initial value is always NULL regardless of scale/precision. Option D is false - uninitialized variables can be used, though they will have NULL values which may affect logic.