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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the command used to fetch first 5 characters of the string? : Sql dba

1140


how to return query output in html format? : Sql dba

653


Why function is used in sql?

524


what is the different between now() and current_date()? : Sql dba

526


Advantages and disadvantages of stored procedure?

583






what is a join? : Sql dba

565


Where the sql database files are stored?

498


What are stored procedures used for?

537


How can we debug in PL/SQL?

663


What are the different types of database management systems?

534


What is cursor explain with example?

560


Can a primary key be a foreign key?

579


Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?

626


Are dml statements autocommit?

557


What will you get by the cursor attribute sql%found?

540