HOW TO ADD PRIMARY KEY TO TABLE BY PL/SQL PROGRAM

Answers were Sorted based on User's Feedback



HOW TO ADD PRIMARY KEY TO TABLE BY PL/SQL PROGRAM ..

Answer / prativa mishra

begin
execute immediate('alter table table_name add constraint constraint_name primary key(column_name)');
end;

Is This Answer Correct ?    13 Yes 0 No

HOW TO ADD PRIMARY KEY TO TABLE BY PL/SQL PROGRAM ..

Answer / prativa mishra

BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE TABLE_NAME ADD CONSTRAINT PK1
PRIMARY KEY(COLUMN_NAME)';
END;

Is This Answer Correct ?    2 Yes 0 No

HOW TO ADD PRIMARY KEY TO TABLE BY PL/SQL PROGRAM ..

Answer / saran

alter <tablename> attributename,constriantname

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More SQL PLSQL Interview Questions

What do you mean by stored procedures? How do we use it?

0 Answers  


How did you export data from database to excel file.

1 Answers   TCS,


What is normalization? How many normalization forms are there?

0 Answers  


what are %TYPE and %ROWTYPE? what is the difference?

7 Answers   ICICI, Saama Tech, Sail,


Is record in oracle pl sql?

0 Answers  






How many types of primary keys are there?

0 Answers  


What is a sql trace file?

0 Answers  


Why use truncate instead of delete?

0 Answers  


what is the difference between delete and truncate commands? : Sql dba

0 Answers  


Which is better stored procedure or query?

0 Answers  


What is difference between Procedures and Functions ?

6 Answers   Hi Caliber IT,


How many types of indexes are there in sql?

0 Answers  


Categories