Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6872615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:57:06+00:00 2026-05-27T03:57:06+00:00

I get this error when trying to delete a row on a view ORA-01732:

  • 0

I get this error when trying to delete a row on a view

“ORA-01732: data manipulation operation not legal on this view “

SQL Command issued is

DELETE FROM RegisterHelper
WHERE StudentID = 111111111 AND CourseID = 'ASD123';

This creates the errors. I’ve doublechecked that these values exists.

My view is

CREATE VIEW RegisterHelper AS
SELECT studentId, courseID, NULL as position, 'registered' AS status
FROM registeredOn
UNION
SELECT studentId, courseID, position, 'waiting' AS status
FROM waitingOn;

This view creates a complete list of waiting and registered students on all courses, together with their status (which is used in the trigger). All the data given here is essential to the trigger.

Trigger is

CREATE OR REPLACE TRIGGER CourseUnregistration
INSTEAD OF DELETE ON RegisterHelper
etc

Tables are as follows

CREATE TABLE RegisteredOn (
    StudentID REFERENCES Student(StudentID) NOT NULL,
    CourseID REFERENCES Course(CourseID) NOT NULL
);

CREATE TABLE WaitingOn (
    StudentID  REFERENCES Student(StudentID) NOT NULL,
    CourseID REFERENCES Course(CourseID) NOT NULL,
    Position INT NOT NULL,

    PRIMARY KEY(StudentID, CourseID)
);

Since I only delete from tables with references values, there will be no problems with deleting values with are referenced (obviously) – this should pose no problem.

An interesting thing was that it actually worked to issue the DELETE command on the RegisterHelper view a few hours ago. For some reason it has stopped working, and I can’t remember changing it.

The reason the trigger exists on the RegisterHelper view is because students are both inserted and removed on the RegisteredOn and WaitingOn table. Inserts works fine, removal does not, as I get the error.

Simply put, I just want the trigger to work when something is deleted on the RegisteredOn or WaitingOn tables. If anyone has a different solution I’m open to it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:57:07+00:00Added an answer on May 27, 2026 at 3:57 am

    You can’t delete from a view with unioned tables that are different. You will need to execute two different delete statements, one for each table.

    Update

    In order to make the operation as easy from code as the single delete statement you are looking for now, I would suggest that you create a stored procedure to perform the deletion and pass the student and course information to this proc.

    This is a good general design anyway because if you add additional tables whose data may need to be deleted in the future in the same logic (lab registration, for example), then you only have to modify the stored procedure and not the dynamic SQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error: System.Reflection.TargetException: Object does not match target type. when trying to
I'm trying to import IIS logs into SQL Server 2008. I get this error
i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this
I am getting this error when trying to delete a row out of a
I'm trying to delete a user using Django Admin, but I get this error:
I get this error when trying ruby script/console Rails requires RubyGems >= . Please
I get this error when trying to link a win32 exe project. I have
I get this error when trying to load a Zend Framework application: Fatal error:
i get this error when trying this: ERROR method name expected. How should i
I always get this error when trying to compile my file with Boost::GIL PNG

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.