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

  • Home
  • SEARCH
  • 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 7024699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:52:33+00:00 2026-05-27T23:52:33+00:00

I would like to ask a question about triggers. Let’s say that I have

  • 0

I would like to ask a question about triggers. Let’s say that I have a table T and I need a trigger before update. However, I have a problem. I need to check a condition using the other rows of T from the trigger. My question is: Which RDBMS’s support this? Where can I write triggers which perform selection(s) on the same table where the trigger fires. For instance:

CREATE TRIGGER updtrigger BEFORE UPDATE ON Employee
    -> FOR EACH ROW
    -> BEGIN
    -> IF NEW.Salary<=500 THEN
    -> SET NEW.Salary=10000;
    -> ELSEIF NEW.Salary>500 and NEW.Salary < 600 THEN
    -> SET NEW.Salary=15000;
    -> ELSEIF NEW.Salary > (select MAX(Salary) from Employee)
    -> Set NEW.Salary = 601;
    -> END IF;
    -> END
    -> //

Thank you,

Best regards,

Lajos Arpad.

  • 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-27T23:52:34+00:00Added an answer on May 27, 2026 at 11:52 pm

    The given trigger will throw an Mutating table exception in Oracle, for example, but there is a solution in Oracle, for instance this trigger is allowed and it works fine:

    CREATE or replace TRIGGER updtrigger BEFORE UPDATE ON Employees
         FOR EACH ROW
    DECLARE
     pragma autonomous_transaction;
     n number;
         BEGIN
         select MAX(Salary) into n from Employees;
         IF :NEW.Salary<=500 THEN
              DBMS_OUTPUT.PUT_LINE('kisebb mint 500');
              :NEW.salary:=n;
        end if;
    commit;
         END;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to ask something about query using mysql I have this table
I would like to ask you a question about logging provided jars. I have
I would like to ask a question about correct way of canceling socket operations
I would like to ask a question about a new and large scale web
I would like to ask about the design of table based on it's editability
I would like to ask a theoritical question about how some web sites work.
I am new to iPhone development. I have a question would like to ask.
I would like to ask you a question about implementing mutual authentication with Kerberos,
There are some discussions about the same question but I would like to ask
I'd like ask a question about building applications in .NET that use data from

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.