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 8076977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:22:42+00:00 2026-06-05T15:22:42+00:00

I have a trigger that looks something like this: create or replace TRIGGER cluster_check

  • 0

I have a trigger that looks something like this:

create or replace
TRIGGER cluster_check
before insert on my_table
FOR EACH ROW

when (passive_server = new.server)

begin
ROLLBACK;
UPDATE my_table
set (server,passive_server) = (passive_server,server) where passive_server = new.server;
end;

I am getting the error Error: ORA-04076: invalid NEW or OLD specification on compilation.

Essentially what I am trying to do is check on insert to see if the incoming server matches the passive server in another record and if so cancel the insert and swap the existing records passive and active servers.

What am I doing wrong?

  • 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-06-05T15:22:44+00:00Added an answer on June 5, 2026 at 3:22 pm

    A trigger on a table can’t change the operation like this.

    You could define a view on top of my_table, do the INSERT against the view, and then have an instead of insert trigger that changed the INSERT operation into an UPDATE. But then all your DML would have to go against the view rather than the table. You could potentially rename the table and then create a view named my_table to make that transition easier.

    Before you go down that path, however, are you certain that you need a trigger in the first place? Are you sure that your application couldn’t do something like call a stored procedure that would determine what to do or that it couldn’t do a MERGE instead of an INSERT?

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

Sidebar

Related Questions

I have an INSERT statement that looks like this: INSERT INTO officer (officer_number, name,
I have a trigger for insert/update/delete. That is working fine. Also, I need the
I have a few UIButtons that I'd like to trigger short 5-10 frame animations
I have a video view that is full screen and would like to trigger
I have tow tables concept_access and concept_access_log. I want to create a trigger that
I have an AFTER INSERT OR UPDATE OR DELETE trigger that I'm writing to
I have a UIView that I'm sliding in using a UIScrollView. Code looks like
I have a trigger that stores changes made in a separate table when a
We have created a table with a trigger that updates a ModifiedDate field in
I have had to make changes to a trigger and assumed that running an

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.