Define & UndefineVariable
in Oracle
Submitted by:
Fatima Qayyum (2015-BCS-011)
Hafsa Zulfiqar (2015-BCS-053)
Group # 3
DEFINE Command
▪ Define command is used to:
1. Define a user variable and assign it a value
2. Display the value of specific user variable
3. Display values of all user variables
▪ Syntax of Define Command:
DEFINE [ variable_name [=value] ]
DEF [ variable_name [=value] ]
2
Examples
3
1
2
3
How to use?
4
UNDEFINE Command
▪ Undefine command is used to:
1. Delete a variable definition
2. You can delete several variables with one command by listing them
▪ A variable remains defined until you either use the undefined
command to clear it or exit the sql plus
▪ Syntax of Undefine command:
UNDEFINE [variable_name]
UNDEF [variable_name]
5
Example:
6
1
2
7

Define & Undefine in SQL

  • 1.
    Define & UndefineVariable inOracle Submitted by: Fatima Qayyum (2015-BCS-011) Hafsa Zulfiqar (2015-BCS-053) Group # 3
  • 2.
    DEFINE Command ▪ Definecommand is used to: 1. Define a user variable and assign it a value 2. Display the value of specific user variable 3. Display values of all user variables ▪ Syntax of Define Command: DEFINE [ variable_name [=value] ] DEF [ variable_name [=value] ] 2
  • 3.
  • 4.
  • 5.
    UNDEFINE Command ▪ Undefinecommand is used to: 1. Delete a variable definition 2. You can delete several variables with one command by listing them ▪ A variable remains defined until you either use the undefined command to clear it or exit the sql plus ▪ Syntax of Undefine command: UNDEFINE [variable_name] UNDEF [variable_name] 5
  • 6.
  • 7.