Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Student SQL question
In article <01bd8279$03db4f80$049a0580_at_mcb>, "Matt Brennan" wrote:
>
>> 2. Once a table is created, a column in that table cannot be deleted
>
>True. You have to drop the table and then re-create the table. Save the
>existing rows in another table first and then re-insert them in the new
>table. I think that's dumb, but what can you do? I don't know why Oracle
>won't let you drop a column. One would think it's the easiest thing to do,
>as opposed to modifying an existing column.
>
I always thought it was down to referential integrity. It cannot be THAT difficult to cascade the delete to integrity constraints.
I suspect the way that the data dictionary has been designed has a major part to play with Oracle not providing this functionality.
>>or a datatype of a column cannot be changed
>
>Not true. But all rows have to have a null value for the column in order
>to do it.
>
>>the tablename cannot be changed (as far as I know)
>
>Haven't tried that myself, but I saw a post where someone else answered it.
RENAME table_name TO new_table_name;
Note: You cannot rename indexes and they do not get renamed with this operation.
Neil Chandler
TCAM Systems (UK) Ltd.
Oracle DBA.
Received on Tue May 19 1998 - 06:42:56 CDT