Quick Search:
 
 Oracle PL/SQL: TABLE: Constraints Jump to:  
Category: >> Oracle PL/SQL >> TABLE: Constraints  

<< lastnext >>

Snippet Name: TABLE: Constraints

Description: Creating a table with NOT NULL constraints

Also see:
» TABLESPACE: Show contiguous space
» TABLESPACE: SYSAUX tablespace
» TABLESPACE: Tablespace management
» TABLESPACE: List tablespaces, files, ...
» TABLESPACE: Dropping Tablespaces
» TABLESPACE: Alter Permanent Tablespace
» TABLESPACE: Transportable tablespaces
» TABLESPACE: Tempfile operations
» TABLESPACE: Create temp tablespace
» TABLESPACE: Change UNDO tablespace
» TABLESPACE: Undo Tablespace
» TABLESPACE: SYSAUX Tablespace
» TABLESPACE: Set default tablespace type
» TABLESPACE: Oracle Managed Auto-extend...
» TABLESPACE: Permanent Tablespace Using...
» TABLE: Options
» TABLE: Using Select Statement With Data
» TABLE:  Multiple Columns
» TABLE:  queries
» TABLE: simple heap table
» TABLESPACE: Using Raw Devices
» TABLESPACE: permanent tablespace

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 11th, 2009

CREATE TABLE test6 (
id   NUMBER(5) NOT NULL,
f_name VARCHAR2(20),
l_name VARCHAR2(25));
 
ALTER TABLE test6 MODIFY (id NULL);
 
ALTER TABLE test6  MODIFY (id NOT NULL);
 
 
-- For example, a column in a table can be specified NOT NULL. 
-- It's not possible to insert a null in such a column. In the following 
-- create table statement, a null can be inserted into the column named c. 
 
CREATE TABLE ri_not_null (
  a NUMBER NOT NULL,
  b NUMBER     NULL,
  c NUMBER
);
 
INSERT INTO ri_not_null VALUES (   1, NULL, NULL);
INSERT INTO ri_not_null VALUES (   2,    3,    4);
INSERT INTO ri_not_null VALUES (NULL,    5,    6);
 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org