setting the primary key
5 posters
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
setting the primary key
how to set the primary key of a table that is already created....!!!!
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: setting the primary key
for adding a primary key constraint on an existing table here is the syntax
ALTER TABLE <Tablename> ADD CONSTRAINT <constraint name> PRIMARY KEY(<Column Name>);
ALTER TABLE <Tablename> ADD CONSTRAINT <constraint name> PRIMARY KEY(<Column Name>);
rohit_1000r- Posts : 4
Points : 4
Join date : 2010-03-09
Re: setting the primary key
This ll also work.
- Code:
ALTER TABLE <TABLENAME> MODIFY(<FIELDNAME> <TYPE> PRIMARY KEY);
Re: setting the primary key
how can we identify an existing primary key!!!
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: setting the primary key
@christopher
Wat is the "type" in alter command
Wat is the "type" in alter command
jennyinhere- Posts : 24
Points : 30
Join date : 2010-02-26
Age : 35
Re: setting the primary key
@jeeva
sql> desc <tablename>;
@jenny
datatype (number or varchar2)....
sql> desc <tablename>;
@jenny
datatype (number or varchar2)....
Mahee- Posts : 29
Points : 233
Join date : 2010-03-03
Location : Haldia
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|