PL/SQL INT

The PL/SQL INT data type in Oracle database is used to store whole numbers.

Syntax

The syntax for declaring a variable of type INT is:

variable_name INT;

Example

For example, the following declaration creates a variable called var_int:

declare
var_int INT;
begin
var_int := 10; 
dbms_output.put_line('1. var_int = '||var_int); 

var_int := var_int * 2; 
dbms_output.put_line('2. var_int = '||var_int); 
end;

In the example above, we first declare a variable called var_int of type INT. We then assign the value 10 to it and print it out to the screen. We then multiply the value of var_int by 2 and print it out again.

As you can see, the PL/SQL INT data type is a simple and straightforward way to store whole numbers in Oracle database.