PL/SQL Variable

Advertisements

DataType in PLSQL Constant in PLSQL

PL/SQL Variable

AVariable is an identifier which holds data or another one variable is an identifier whose value can be changed at the execution time of program.

Variable declaration

Syntax

variable_name datatype;

Example

a number;

Variable Initialization

Syntax

variable_name datatype:=value;

Example

a number=10;

Rules for variable declaration

  • Variable name start with alphabet.
  • Variable name contains minimum one character and maximum 30 character.
  • It should not allow any space and any special character.
  • Keywords are not allow to declare as a variable name.

Example of variable declaration and initialization.

Example

DECLARE
num1 number; 
num2 number; 
BEGIN 
num1 := 10; 
num2 := 20; 
DECLARE 
c number; 
BEGIN 
c := num1 + num2; 
dbms_output.put_line('Sum: 'c);
END; 
END;

Output

Sum: 30

DataType in PLSQL Constant in PLSQL

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements