Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL NATURALN Datatype      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: NATURALN

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:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 206 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?