What are variables?
v Variables
are place holder in computer memory that holds some data. We can call them
variables because which can be changed any point in your program.
v Every
variable must have a valid name, a data type and a data width.
v In
PL/SQL every variable must be declared prior to its use and the declaration of
the variables or even other objects can only be done in the declaration section
of the PL/SQL block.
There are two ways assigning the value
in PL/SQL:
Example: 1
Explanation:
§ V_var is the variable name, the datatype of the
variable VARCHAR and the width is 50.
§ := is the assignment operator for assigning value into
the variable.
§ 'Welcome to PL/SQL' is the value must be enclosed with single quotes (‘’)
§ In this example we DECLARING and INITIALIZING the variable in DECLARE section.
Output:
Example: 2
Explanation:
No comments:
Post a Comment