New added columns are empty : Alter Table « Table « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » Table » Alter Table 
6. 3. 17. New added columns are empty
SQL> create table employee(
  2    employee_id     number(9),
  3    first_name      varchar2(15),
  4    last_name       varchar2(20),
  5    email           varchar2(25),
  6    constraint pk_employee primary key (employee_id)
  7  );

Table created.

SQL>
SQL> insert into employee
  2  values (1'Tom', 'Kyte', 't@aaa.com');

row created.

SQL>
SQL> insert into employee
  2  values (2'Sean', 'Dillon', 's@aaa.com');

row created.

SQL>
SQL> insert into employee
  2  values (3'Christopher', 'Beck', 'c@aaa.com');

row created.

SQL>
SQL> commit;

Commit complete.

SQL>
SQL> select *
  2  from employee;


EMPLOYEE_ID FIRST_NAME           LAST_NAME            EMAIL
----------- -------------------- -------------------- -------------------------
          Tom                  Kyte                 t@aaa.com
          Sean                 Dillon               s@aaa.com
          Christopher          Beck                 c@aaa.com

rows selected.

SQL> alter table employee
  2  add (
  3    phone_number    varchar2(10)
  4  )
  5  /

Table altered.

SQL>
SQL> select *
  2  from employee;


EMPLOYEE_ID FIRST_NAME           LAST_NAME            EMAIL                     PHONE_NUMB
----------- -------------------- -------------------- ------------------------- ----------
          Tom                  Kyte                 t@aaa.com
          Sean                 Dillon               s@aaa.com
          Christopher          Beck                 c@aaa.com

rows selected.

SQL> drop table employee;

Table dropped.

SQL>
SQL>
6. 3. Alter Table
6. 3. 1. Altering a Table
6. 3. 2. Some of the aspects of a column you can modify using ALTER TABLE
6. 3. 3. Adding a Column
6. 3. 4. ADD initially_created DATE DEFAULT SYSDATE NOT NULL;
6. 3. 5. Changing the Size of a Column
6. 3. 6. Decrease the length of a column
6. 3. 7. Changing the Precision of a Numeric Column
6. 3. 8. Decrease the precision of a numeric column
6. 3. 9. Changing the Data Type of a Column
6. 3. 10. Fill data into new added table column
6. 3. 11. Changing the Default Value of a Column
6. 3. 12. Alter table to add new constraint for new added column
6. 3. 13. ALTER TABLE to DISABLE a CONSTRAINT
6. 3. 14. Alter table to add primary key
6. 3. 15. Alter table to add primary key across more than one columns
6. 3. 16. Dropping a Column
6. 3. 17. New added columns are empty
6. 3. 18. Alter table to add unique with tablespace and storage setting
6. 3. 19. Alter table to add primary key with tablespace and storage setting
6. 3. 20. alter table nologging
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.