Trigger help please

Hello

I am asked to write a trigger check that when the salary is updated (for an existing faculty member) the raise is not more than 12%. Provide data of test and test results to confirm that the trigger works.


The table of the Faculty is here:


F_ID, F_LAST, F_FIRST, F_MI, LOC_ID, F_PHONE, F_RANK, F_SALARY, F_SUPER, F_PIN, F_PIN


It is a single line of the table where LOC_ID is a foreign key to the location of the table.


1MarxTeresaJ94075921695Partner7500046338(BLOB)


Any help would be massively appreciated.

Ollie

Simple example:

drop table test15;

create the table test15

(

primary key ID number,

Name varchar2 (20).

number of SAL

);

Select * from test15;

CREATE OR REPLACE TRIGGER TRG_test15

after update of the sal on test15

FOR EACH LINE

DECLARE

sal_diff NUMBER;

BEGIN

sal_diff: =: NEW.sal -: OLD.sal;

If (sal_diff >: OLD.sal * 12/100) then

RAISE_APPLICATION_ERROR (-20000, 'Recovery cannot be more than 12%.');

on the other

null;

end if;

end;

/

insert into test15 values(1,'ABC',1000);

insert into test15 values(3,'MNP',3000);

Update test15 set sal = 4000 where id = 3;

error from the 193 in command line:

Update test15 set sal = 4000 where id = 3

Error report:

SQL error: ORA-20000: stimulus may not exceed 12%.

ORA-06512: at "HR. TRG_TEST15', line 6

ORA-04088: error during execution of trigger ' HR. TRG_TEST15'

20000 00000 - '%s '.

* Cause: The stored procedure 'raise_application_error.

We called that causes this error to be generated.

* Action: Fix the problem, as described in the error message or contact

the administrator of the application or the DBA for more information.

Tags: Database

Similar Questions

  • I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    11.1 and especially you have virtual column

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c generated always as (a+b) virtual
      6  );
    
    Table created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    

    Before that, a front insert - trigger

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c number
      6  );
    
    Table created.
    
    SQL> create or replace trigger t_default before insert on t for each row
      2  begin
      3    :new.c := :new.a+:new.b;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    
  • Sequence by select Help please:

    First of all, I'm rather at this new and need help please.

    I created the following sequence:

    CREATE SEQUENCES SQ_CASE_NUMB

    MINVALUE 1

    INCREMENT BY 1

    START WITH 1

    And from this sequence select it below:

    SELECT TO_CHAR (SQ_CASE_NUMB. NEXTVAL)

    | | To_char (SYSDATE, "fm/MM/yy")

    Case_NUMB

    OF THE DOUBLE

    Result:

    Case_NUMB

    08/01/14

    08/02/14

    08/03/14

    Can I combine the sequence 'create' and 'select '? Or should I create a function?

    What is the best option please?

    It depends on what you're trying to reach.  What you use the sequence for?  Primary key?  Experiment?  fun?

    Best option can be answered only if you provide the object...

    BTW - the select query above works, but it does not mean that you should use...  The best thing to do (if you use it as a primary key) is to create a trigger like this:

    create or replace

    TRIGGER "insert name here".

    BEFORE INSERT ON table_name

    FOR EACH LINE

    BEGIN

    SELECT sequence_name. NEXTVAL INTO: DOUBLE NEW.pkcolumn_name;

    END;

  • Help, please! to stop the animation of a symbol of the stadium or anover

    I'm not a specialist of jquery, but I had to deal with it. And have some expirience... But I can't do a basic thing along the busy, I guess. So, help me please!))

    I need to stop certain symbols of the child of the chronology of the symbol of the parent (or stage). The chronology of the scene, I have trigger. Currently, all child clips must stop as a...

    I'm trying to insert into the shutter button, copy the following code:

    (child clips names: 'stan', 'bizan', 'bak')

    var stantostop = sym.$("stan");
    stantostop. Stop();

    var bizantostop = sym.$("bizan");

    stantostop. Stop();

    var baktostop = sym.$("bak");

    stantostop. Stop();

    and I'm sure, I'm doing something wrong (!), cause, nothing changes.

    If you can't help, please advice me some source with many examples of typical operations and commands like this! So thank you for reading!

    Hi, Strashevsky-

    You don't need to refer to the object jQuery if all you want to do is stop the timeline.  You can simply do:

    sym.getSymbol("stan").stop ();

    OR

    var stantostop = sym.getSymbol ("stan");

    stantostop. Stop();

    Hope this help get you pointed in the right direction!

    -Elaine

  • Should not hide or get rid of front loader bar. Help, please

    [b] OK, why not work?

    Trying to do a

    Navigation bar button, of preloader for abour my page with an element of the picture.

    Not on the charger page pre bar works, it doesn't disappear. [/ b]

    [pre] s [color = blue] iteLoader.loadMovie("AboutMe5.swf",4);

    Frame_movie._alpha = 100;

    loadingBar._alpha = 100;

    loadingBar._xscale = 1;

    loadingBar.onEnterFrame = function()

    {

    kBytesLoaded = this._parent.siteLoader.getBytesLoaded () / 1024;

    kBytesTotal = this._parent.siteLoader.getBytesTotal () / 1024;

    percentage = Math.round (kBytesLoaded/kBytesTotal * 100);

    This ._xscale = percent;

    If ('percentage' == 99) {}

    loadingBar._alpha = 0;

    Frame_movie._alpha = 0;

    delete this.onEnterFrame;

    }

    [/ Color]

    } [/pre]

    [b] the navigation bar has the following script [/ b]

    [pre] [color = blue] Button_AboutMe.onRelease = function() {}

    unloadMovie (4);

    loadMovie("AboutMe_Loader.swf",4);

    } [/ Color] [/pre]

    [b] the loaded movie is just like the script [/ b]

    [color = blue] stop (); [/ Color]

    [b] now, I added this script in the final AboutMe5.swf file to try to hide the bar but does not work, also tried using different layers and the unloadMovie (4); script. It did not work.

    [/ b]

    [pre] [color = blue] unloadMovie (4);

    loadingBar._alpha = 25;

    Frame_movie._alpha = 25;

    SiteLoader._alpha = 10

    loadingBar._alpha = 1;

    This ._alpha = 1;

    Frame_movie._alpha = 1; [/ Color] [/pre]

    [b] now Frame_move is a mov (and I tried the button) and the laoding bar is a mov file. I can do these melted by adusting the alpah, but this only works on the film. I can't trigger it with the line.

    [/ b]

    [color = blue] [pre] if ('percentage' == 99) {[/pre] [/ Color]}

    Ive tried with and without the single and double quotes. and plan.

    tried to replace the percentage with

    This ._xscale

    loading bar

    Nothing works.

    It seems to be the case of script that is the problem do not trigger the ADF or gettig the front loader quite red.

    Help, please

    THANK YOU VERY VERY MUCH

    Finally got it work.

    What on earth we were doing wrong all this time?

    Could you explain to us who know so what Im doing next time rather than cut and paste your script please. Think others benefit from it.

    the script work is

    Stop();

    siteLoader.loadMovie("Aboutme5.swf",4);

    Frame_movie._alpha = 100;

    loadingBar._alpha = 100;

    loadingBar._xscale = 1;

    loadingBar.onEnterFrame = function() {}

    kBytesLoaded = this._parent.siteLoader.getBytesLoaded () / 1024;

    kBytesTotal = this._parent.siteLoader.getBytesTotal () / 1024;

    If (kBytesLoaded > 1) {}

    percentage = Math.round(kBytesLoaded/kBytesTotal*100);

    This ._xscale = percent;

    If (percentage > = 99) {}

    Frame_movie.swapDepths (this._parent.getNextHighestDepth ());

    Frame_movie.removeMovieClip ();

    This._parent.nextFrame ();

    delete this.onEnterFrame;

    loadingBar.swapDepths (this._parent.getNextHighestDepth ());

    loadingBar.removeMovieClip ();

    }

    }

    };

    Left on the yahoo mentioned above mail drop box

  • After my 10 updated iOS even if I am connected to view the content I have cloud and iCloud when I try it asks me to put in place when already established sound upward. Help, please

    After the last update of iOS10. Even though I am connected to iCloud when I try to display the content he asks me to implement the iCloud. Can anyone help please.

    Try to perform a restart- restart your iPhone, iPad or iPod touch - Apple Support

  • When I started to update my iphone to ios 10 and watch 3.0, cannot already display the pictures of my watch. Logo of loading only. And he thinks it will take a hayss of 1000 years. Help, please

    When I started to update my iphone to ios 10 and watch 3.0, cannot already display the pictures of my watch. Logo of loading only. And he thinks it will take a hayss of 1000 years. Help, please

    Hello

    If the software on your watch is being updated, leave your watch and your iPhone until the process is complete (including the not remove your watch on the charger):

    Update the software on your Apple Watch - Apple Support

  • I can't reach some websites with any browser. I get the message ERR_CONNECTION_REFUSED. If I boot in safe mode I don't have the issue. I tried the reset and repair of everything. Help, please

    I can't reach some websites with any browser. I get the message ERR_CONNECTION_REFUSED. If I boot in safe mode I don't have the issue. I tried the reset and repair of everything. Help, please

    Try to run this program in your usual account, then copy and paste the result in a response. The program was created by Etresoft, a regular contributor.  Use please copy and paste the screenshots can be difficult to read. On the screen with the Options, please open Options and tick the boxes in the bottom 2 before the race. Click on the button "Report share" in the toolbar, select "Copy to Clipboard" and then paste into a response. This will show what is running on your computer. No personal information is shown.

    Etrecheck - Information System

  • Notes crashes in the Sierra. Help, please!

    After the upgrade on my iMac (mid-2014), I can't open the Notes. Crashes every time after I clicked through the tutorial on the new updates for Notes. Help, please! Thank you!

    Stop your restart the computer. Launch of Notes, but do not use the tutorial.

  • I have an imac 27 "... on power there is no signal to startap, usb ports are not working and its deadlock with the logo of the Apple with the circle of rotation... Help, please

    I have an imac 27 "... on power there is no signal to startap, usb ports are not working and its deadlock with the logo of the Apple with the circle of rotation... Help, please

    Wake the computer to your Apple store or Apple authorized service for the service provider. He probably suffered a hardware failure.

  • I NEED HELP Please im having a problem to forget my password and when I plug it it says its locked with a password he try to put the itunes thing but

    NEED HELP Please im having a problem to forget my password and when I plug it it says its locked with a password he tried to put the itunes thing but it says enter password I put in what I rember, then said lokced for five minutes help me pls

    Without knowing the password for your iPhone, there is no way to unlock it, bring even you to the Genius Bar. If you continue to enter the wrong password, you will be locked out of your iPhone, and your data will be unaccessable.

  • lost or stolen iPhone. It is w / 'Find my iPhone', later received email that it has been found. No call and impossible to recover, now phone is in offline mode. I am leasing through the iPhone upgrade program. Help, please.

    6 sec more lost/stolen iPhone. Turned on the 'lost' Mode and displays the number to call if found on-screen. It is w / "Find my iPhone", went up, no response from any home in the area. Later received an email that it was found, still no call to the number on the screen. Several unsuccessful attempts to get it back, now the phone is in offline mode and says that the history of the site is not available. I left a note on all the doors in the place indicated on the "find my iPhone" describing my phone lost and left a number to call. I am leasing through the iPhone upgrade program. Help, please.

    There is no way to locate now, unless the one who found it exerts a force on you contact on this number you posted

    The good news is, since you have find my iPhone, they will not be able to reuse the phone even if they are trying to restore. Unless they know your password, or you have a valid proof of purchase AGFI won't be deleted.

    So if the person who found the phone knows about it, he or she would rather go back because it would be of no use to them.

  • I lost my iphone and its dead and I can't find on find my iphone help please!

    I lost my iphone it also died and find my iphone does not. help please

    Nothing we or anyone can do.

    If your iDevice is lost or stolen

    If enable you find my phone before it was lost or stolen, you can track only when connected to the Internet by Wi - Fi or cellular. What you can't do, is follow your device using a serial number or other identification number. Neither Apple nor anyone else may find your device. You can't recover your loss unless you make your device for the loss. It is not covered by your warranty.

    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen, what do you do? There are things you should have done in advance - until you have lost it or it has been stolen - and things to do after the fact. Here are a few suggestions:

    1. declaration of a lost or stolen Apple product

    2 find my lost iPod Touch

    3. AT & t. Sprint and Verizon can block phones stolen/tablets

    4. What-To-Do-When-Iphone-Is-Stolen

    5. use ICloud Mode lost

    6. what to do if your iOS device is lost or stolen

    7 6 ways to track and recover your lost/stolen iPhone

    8. find my iPhone

    9 report Stolen iPad | Stolen lost found online

    It pays to be proactive in following the advice on the use of find my phone before you lose your device:

    1. find my iPhone

    2 set up your iDevice oniCloud

    3. OS X Lion/Mountain Lion - in regard to my Mac

    4 the free configuration find your iPhone (even on unsupporteddevices)

  • I want to scan in my bar-coded pass for our local sports club. Help please.

    I would like to analyze in some of our LOCAL little bar pass coded for sports clubs and our library. I can't find an app that will allow for this. Help please!

    Take a picture.

  • Hi someone help please I am signing the apple tv correctly and it says the password for itunes that is incorrect. However, I am now connected from my computer and it is OK

    Hi someone help please I am signing the apple tv correctly and it says the password for itunes that is incorrect. However, I am now connected from my computer and it is OK

    Have you tried to reboot your router, correct your location settings, you use audit stage 2.

Maybe you are looking for

  • I'll be updating to iOS 10?

    I have 2 iPad 2 Air... He was recenfly replaced by Apple when the problem, connect to the router home after update to iOS 10. WiFi see link Ipad does not connect to internet 2 returned by Apple iPads have iOS 9 and application to update. After the pr

  • 'Open recent' only shows "clear menu".

    When I pull up on the tab 'Open recent' numbers (and Pages), it shows "Clear Menu" - it does not show my recent files. I thought I fixed this time before. Why it is failing in the Menu 'clear' and how do I change it back so that it gives me my docume

  • invalid boot.ini file

    Invalid Boot.ini, after press R for recovery... ask what window installation you want to log on... can you tell me the answer... thx

  • Where can I download windows 7 ultimate 32 bit to upgrade a Vista Home Premium 32 bit?

    Hello I have a little problem. I have this Toshiba laptop comes with Windows Vista Home Premium 32 bit version. It came with a free upgrade to Windows 7. Toshiba not did me not a CD for Windows Vista or 7. I was too lazy to update. Now my computer ha

  • How can I recover my computer to an earlier point settings?

    My computer said it will restart in 14 minutes, then started a count down... When he did he showed that there are three steps to restart... Then my computer stopped and re-started... None of my settings, or whatever it is was the same. How can I rest