Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Oracle Tips
Got Q uestions? Free AWR Report Analysis Restart a Failed Daemon Process BEWARE of 11gR2 Upgrade Gotchas! Oracle 12c has been released
For complete tips on Oracle alter table syntax, see the book "Easy Oracle Jumpstart". Oracle provides "alter table" syntax to modify data columns in-place in this form:
a l t e rt a b l e t a b l e _ n a m e m o d i f y c o l u m n _ n a m e d a t a t y p e ;
If you are brave you can use a single "alter table" syntax to modify multiple columns:
Remote DBA Oracle Tuning Emergency 911 RAC Support Apps Support Analysis Design Implementation Oracle Support
a l t e rt a b l e t a b l e _ n a m e m o d i f y ( c o l u m n 1 _ n a m e c o l u m n 2 _ n a m e c o l u m n 3 _ n a m e c o l u m n 4 _ n a m e ) ;
c o l u m n 1 _ d a t a t y p e , c o l u m n 2 _ d a t a t y p e , c o l u m n 3 _ d a t a t y p e , c o l u m n 4 _ d a t a t y p e
Here are some examples of Oracle "alter table" syntax to modify data columns and note that you can add constraints like NOT NULL:
A L T E RT A B L E c u s t o m e r M O D I F Y ( c u s t _ n a m ev a r c h a r 2 ( 1 0 0 )n o tn u l l , c u s t _ h a i r _ c o l o r v a r c h a r 2 ( 2 0 ) ) ;
SQL Tuning Security Oracle UNIX Oracle Linux Monitoring Remote support Remote plans Remote services Application Server Applications Oracle Forms Oracle Portal App Upgrades SQL Server Oracle Concepts Softw are Support Remote Support Development Implementation
We can also use Oracle "alter table" syntax in dynamic PL/SQL to modify data columns
B E G I N S Q L _ S T R I N G: =' A L T E RT A B L E' | | : T A B L E _ N A M E | | 'M O D I F Y' | | : C O L U M N _ N A M E | | 'V A R C H A R 2 ( 1 0 0 ) ' ; ... E N D ;
www.dba-oracle.com/t_alter_table_modify_column_syntax_example.htm
1/3
25/09/13
Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals. Feel free to ask questions on our Oracle forum. Verify experience! Anyone considering using the services of an Oracle support
www.dba-oracle.com/t_alter_table_modify_column_syntax_example.htm
2/3
25/09/13
Burleson Consulting
The Oracle of Database Support Oracle Performance Tuning
Copyright 1996 - 2012 All rights re se rve d. O racle is the re giste re d trade mark of O racle Corporation.
www.dba-oracle.com/t_alter_table_modify_column_syntax_example.htm
3/3