Skip navigation links

MySQL Forums :: Newbie :: alter table .... add constraint


Advanced Search

Re: alter table .... add constraint
Posted by: Vinood Chuhan ()
Date: April 17, 2012 03:08AM

the following script is not working for me can anyone provide me working script ??



ALTER [IGNORE] TABLE tbl_sdf2
alter_specification [, alter_specification] ...

alter_specification:
table_options
| ADD [COLUMN] col_name column_definition
[FIRST | AFTER col_sdf3 ]
| ADD [COLUMN] (col_name column_definition,...)
| ADD {INDEX|KEY} [index_sdf4]
[index_type] (index_col_sdf5,...)
| ADD [CONSTRAINT [symbol]] PRIMARY KEY
[index_type] (index_col_sdf5,...)
| ADD [CONSTRAINT [symbol]]
UNIQUE [INDEX|KEY] [index_sdf6]
[index_type] (index_col_sdf5,...)
| ADD [FULLTEXT|SPATIAL] [INDEX|KEY] [index_sdf6]
(index_col_name,...)
| ADD [CONSTRAINT [symbol]]
FOREIGN KEY [index_name] (index_col_sdf5,...)
reference_definition
| ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}
| CHANGE [COLUMN] old_col_name new_col_name column_definition
[FIRST|AFTER col_name]
| MODIFY [COLUMN] col_name column_definition
[FIRST | AFTER col_name]
| DROP [COLUMN] col_name
| DROP PRIMARY KEY
| DROP {INDEX|KEY} index_name
| DROP FOREIGN KEY fk_symbol
| DISABLE KEYS
| ENABLE KEYS
| RENAME [TO] new_tbl_name
| ORDER BY col_name [, col_name] ...
| CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]
| [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]
| DISCARD TABLESPACE
| IMPORT TABLESPACE

index_col_name:
col_name [(length)] [ASC | DESC]

index_type:
USING {BTREE | HASH}

table_options:
table_option [[,] table_option]

Options: ReplyQuote


Subject Written By Posted
alter table .... add constraint REMI VERVECKEN 04/15/2012 08:50AM
Re: alter table .... add constraint Peter Brawley 04/15/2012 09:51AM
Re: alter table .... add constraint REMI VERVECKEN 04/15/2012 11:17AM
Re: alter table .... add constraint Peter Brawley 04/15/2012 02:22PM
Re: alter table .... add constraint REMI VERVECKEN 04/16/2012 01:29AM
Re: alter table .... add constraint Peter Brawley 04/16/2012 07:56AM
Re: alter table .... add constraint REMI VERVECKEN 04/16/2012 08:33AM
Re: alter table .... add constraint REMI VERVECKEN 04/16/2012 10:00AM
Re: alter table .... add constraint Vinood Chuhan 04/17/2012 03:08AM
Re: alter table .... add constraint REMI VERVECKEN 04/17/2012 07:46AM
Re: alter table .... add constraint REMI VERVECKEN 04/17/2012 07:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.