PL/SQL PLS_INTEGER

The Oracle PL/SQL PLS_INTEGER data type is used to store numeric data.

Syntax

The syntax for using this data type is as follows:

variable_name PLS_INTEGER;

Example

An example of using this data type is as follows:

declare
v_num PLS_INTEGER := 10;
v_result PLS_INTEGER;
begin
if v_num = 10 then
v_result:=100;
end if;
DBMS_OUTPUT.PUT_LINE('v_result = '||v_result);
end;

The PL/SQL PLS_INTEGER data type is often used in loops or other situations where a number needs to be stored. When using PL/SQL PLS_INTEGER data type, it is important to remember that it can only store whole numbers. Decimal values will not be stored correctly.