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

Can we create table in function?

0 Answers  


what is transaction? : Sql dba

0 Answers  


Explain the difference between rename and alias?

0 Answers  


Are subqueries better than joins?

0 Answers  


What is the difference between a subquery and a join?

0 Answers  






What is native sql query?

0 Answers  


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

0 Answers  


What is a record in pl/sql?

0 Answers  


What is the difference between sql and t sql?

0 Answers  


What is data profiling in sql?

0 Answers  


Can 2 queries be executed simultaneously in a distributed database system?

0 Answers  


How to call a javascript function from pl sql?

0 Answers  


Categories