PL/SQL block to define Variable
Variables and Constants in PL/SQL
Q. Write a PL/SQL block to define Variable (adding two numbers).
- A variable is a meaningful name that provides facility for programmer to store data temporary during execution of code. It helps to manipulate data in PL/SQL.
- A constant is a value used in PL/SQL block that remains unchanged throughout the program and it can be declared and used instead of actual values.
The following program describes, how to define a variable by adding two numbers.
PL/SQL block can be nested within other PL/SQL blocks with the help of BEGIN and END keyword. The code starts with DECLARE and it is used to define all variables, cursors, subprograms and other elements which can be used in the program.