Multiple choice

Which of the following is the correct method of declaring a constant in PL/SQL?

  1. Data constant number (3)=10

  2. Data constant number (3) := 10;

  3. Data constant number (3);

  4. Constant Data number (3) := 10;

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

A constant is a value used in a PL/SQL block that remains unchanged throughout the program. It is declared using the assignment operator ':='. We must assign a value to a constant at the time of declaration. If we do not assign a value to a constant while declaring it and try to assign a value in the execution section, we will get an error.