Knowee
Questions
Features
Study Tools

Error starting at line : 10 File @ /oracle.sqlIn command -alter table BORROWERS drop constraint primary key(AuthorID)Error report -ORA-01735: invalid ALTER TABLE option01735. 00000 - "invalid ALTER TABLE option"*Cause: *Action:

Question

Error starting at line : 10 File @ /oracle.sqlIn command -alter table BORROWERS drop constraint primary key(AuthorID)Error report -ORA-01735: invalid ALTER TABLE option01735. 00000 - "invalid ALTER TABLE option"*Cause: *Action:

🧐 Not the exact question you are looking for?Go ask a question

Solution

The error message you're seeing is due to incorrect syntax in your SQL command. In Oracle SQL, you cannot drop a primary key constraint using the ALTER TABLE command without specifying the constraint name.

Here's how you can do it:

  1. First, you need to find the name of the primary key constraint. You can do this by running the following command:
SELECT constraint_name 
FROM user_constraints 
WHERE table_name = 'BORROWERS' AND constraint_type = 'P';

This will return the name of the primary key constraint on the BORROWERS table.

  1. Once you have the constraint name, you can drop it using the ALTER TABLE command. Replace 'constraint_name' with the actual name of your constraint:
ALTER TABLE BORROWERS DROP CONSTRAINT constraint_name;

Please replace 'constraint_name' with the actual name of the constraint you obtained from the first step. This will drop the primary key constraint from the BORROWERS table.

This problem has been solved

Similar Questions

Error starting at line : 10 File @ /oracle.sqlIn command -alter table BORROWERS drop primary keyError report -ORA-02441: Cannot drop nonexistent primary key02441. 00000 - "Cannot drop nonexistent primary key"*Cause: alter table drop primary key - primary key does not exist.*Action: None

Error starting at line : 8 File @ /oracle.sqlIn command -alter table USERS drop primary key add primary key (Email)Error report -ORA-00933: SQL command not properly ended00933. 00000 - "SQL command not properly ended"*Cause: *Action:

Error starting at line : 9 File @ /oracle.sqlIn command -alter table USERS add key(Email)Error report -ORA-00902: invalid datatype00902. 00000 - "invalid datatype"*Cause: *Action:

Error starting at line : 9 File @ /oracle.sqlIn command -alter table RESERVATIONS modify ReservationTime TIME NULLError report -ORA-22858: invalid alteration of datatype22858. 00000 - "invalid alteration of datatype"*Cause: An attempt was made to modify the column type to object, REF, nested table, VARRAY or LOB type.*Action: Create a new column of the desired type and copy the current

alter table BOOKINGS drop constraint BookingIDError report -ORA-02443: Cannot drop constraint - nonexistent constraint02443. 00000 - "Cannot drop constraint - nonexistent constraint"*Cause: alter table drop constraint <constraint_name>*Action: make sure you supply correct constraint name.

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.