Tuesday, December 11, 2007

New entries will be published by the better blog.

12/11/2007 2:37:20 PM (Mitteleuropäische Zeit , UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
 Thursday, September 28, 2006

Syntax 1

To add a column to an existing table, the ALTER TABLE syntax is:

ALTER TABLE TableName
 ADD ColumnName column-definition;

For example:

ALTER TABLE yourtable
 ADD yourcolumn  varchar2(50);

This will add a column called yourcolumn to the yourtable table.


Syntax 2

To add multiple columns to an existing table, the ALTER TABLE syntax is:

ALTER TABLE TableName
ADD ( column1 column-definition,
column2 column-definition,
...
columnn column_definition );

For example:

ALTER TABLE yourtable
ADD ( yourcolumn1 varchar2(50),
yourcolumn2 varchar2(45) );

This will add two columns (yourcolumn1 and yourcolumn2) to the yourtable table.

9/28/2006 2:00:16 PM (Mitteleuropäische Sommerzeit , UTC+02:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, May 15, 2006
Get all tables including the system ones:
SELECT table_name FROM all_tables;

That will give you only the tables owned by the user that you are connecting as:
SELECT table_name FROM user_tables;

Query table columns:
SELECT * FROM all_tab_cols WHERE table_name = 'whatever table name you are looking for'

Looking for comments on the tables:
SELECT * FROM all_tab_comments WHERE table_name = 'whatever table name you are looking for'
5/15/2006 1:30:39 PM (Mitteleuropäische Sommerzeit , UTC+02:00)  #    Disclaimer  |  Comments [1]  |