Definition:
In Oracle PL/SQL, NATURALN is a 32 bit sub datatype derived from BINARY_INTEGER in Oracle PL/SQL. It allows only positive integers and will not accept NULL values. Therefore, it must be assigned with a default value during table creation. (To allow the assigning of nulls to an integer variable, use NATURAL or POSITIVE.)
Note that NATURALN is a PL/SQL number type and cannot be used in SQL.
Example Usage:
The PL/SQL block below shows that the NATURALN variable cannot contain negative values.
SQL> DECLARE
L_NUM NATURALN;
BEGIN
L_NUM := -1;
END;
/
DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 4
Related Links: