Handling Variables In PLSQL

Published on by LakshmiSaahul,Dhana Royal

Variables In PLSQL

  • Variables must be declared first before the usage. The PL/SQL variables can be a scalar type such as DATE, NUMBER, VARCHAR(2), DATE, BOOLEAN, LONG and CHAR, or a composite type, such array type VARRAY.
  • Only TRUE and FALSE can be assigned to BOOLEAN type of variables.
  • AND, OR, NOT operators can be used to connect BOOLEAN values.

DECLARE
TYPE v_arr IS VARRAY(25) of NUMBER(3);

v1 v_arr;

v_empno employee.empno%TYPE;

BEGIN

v1(2) := 3;
DBMS_OUTPUT.PUT_LINE('The Value of v1(2) = ' || v1(2));

v_empno := 4;

END;

Advertising
To be informed of the latest articles, subscribe:
Comment on this post