Monday, April 25, 2011

Basic Sql Statements

Use ALTER statement  to modify table structure
 ALTER TABLE table_name
   ADD(
         column1_name column1_datatype column1_constraint,
         column2_name column2_datatype column2_constraint 
  );

Example 
ALTER TABLE XXTABLE_NAME

   ADD(
          creation_date DATE,
          last_update_date DATE 
  );


ALTER TABLE XXTABLE_NAME 
 MODIFY 
            last_name VARCHAR2(350);                    --this will make the length of existing last_name column to 350

No comments:

Post a Comment