The alter table name command is used for altering columns. Is there any restrictions for using this command. If so can anyone specify the restrictions associated for these command.
Printable View
The alter table name command is used for altering columns. Is there any restrictions for using this command. If so can anyone specify the restrictions associated for these command.
It is possible to add new columns to the existing table using ALTER TABLE but if you want the new column top be defined as NOT NULL; it is possible only if the table has no rows. Also one more restriction is if one wants to decrease the precision of the column using ALTER TABLE then column to be modified must be empty.
[QUOTE=RyanJames;1138]It is possible to add new columns to the existing table using ALTER TABLE but if you want the new column top be defined as NOT NULL; it is possible only if the table has no rows. Also one more restriction is if one wants to decrease the precision of the column using ALTER TABLE then column to be modified must be empty.[/QUOTE]
I guess in the second case the column to be modified needn't be empty i.e. till the moment the new precision value isn't less than the existing column values we can modify that column.
Correct me if i am wrong.
Yes, if one wants to decrease the precision of the NUMBER type column using ALTER TABLE command then column to be modified must be empty.