The mutation of error in PL/SQL... can not find a solution

So I have this table:

create table weight)
ident done int refers to users.
date of dateW,
float weight,
primary key (ident, dateW)
);

I have a function called BMI who given a userid (ident) calculates the BMI (body mass index) based on the height of the user (it's on the users table) and the weight of the user is put on the table of characters. The feature works very well. Now I want to relax that when the user inserts a new weight, the trigger checks BMI of this user and see if it to reasonable values. I have this:

create or replace
relaxation BMITG
After the insertion on the WEIGHT
for each line
declare
int ident;
Start
ident: =: new.ident;
If BMI (ident) NOT BETWEEN 17 AND 25
then DBMS_OUTPUT. Put_line ('bad BMI');
end if;
end;

The trigger compiles fine, but when I try to insert weights I get:

Error from the 1 in the command line:
insert into a values (1, to_date('2013-01-30','yyyy-mm-dd'), 73) weight
Error report:
SQL error: ORA-04091: table MyDB.WEIGHTS is changing, function of triggering/can not see
ORA-06512: at "MyDB.BMI", line 6
ORA-06512: at "MyDB.BMITG", line 5
ORA-04088: error during execution of trigger 'MyDB.BMITG '.
04091 00000 - "table %s.%s is changing, function of triggering/can not see.
* Cause: A trigger (or plsql user-defined function that is referenced in)
This statement) attempted to watch (or modify) a table that has been
in the Middle being modified by the statement that shot.
* Action: Rewrite the trigger (or function) so it does not read this table.

I'm not so sure about the DBMS_OUTPUT. PUT_LINE. Which function to use to alert a user that the BMI is not good? I'll need to convey this message to a Web site through apache/php

Kind regards
Daniel

A level trigger line on WEIGHT cannot query the table of CHARACTERS (or call a function that queries the table of CHARACTERS). In doing so, as you've found, will trigger an error table mutation.

I'm not sure I understand why you should query the table of CHARACTERS, however. If you insert a row into the table of CHARACTERS, which is the line with the weight that you want to use for the calculation, which is probably be the line with the last DATEW or not (if you insert never back-dated lines DATEW, then the line you insert is the line you want to use for the calculation and the line with the last value DATEW).

As a general rule, I would say that the BMI function should accept a height and weight. In your trigger, you question the USERS table to get the height. Then you would spend the height and the: new.weight the new feature of the IMC.

Justin

Tags: Database

Similar Questions

  • I get an error message that Windows can not find a certificate when I try to use my Verizon's MiFI Jetback.

    I have a Verizon Mi - Fi Jetpack.

    I have a Verizon MI-Fi's Jetpack.  It works fine on my Windows 7 computer, but on this computer (Windows XP with Service Pack 3), I get an error message that Windows can not find a certificate.  It won't let me connect even if it shows excellent signal, etc.  Need help.  Thank you

    Hello

    1. when exactly you get this error message?

    2. What is the model of the unit?

    Check if the device is compatible with Windows XP by referring to the user's manual.

    I suggest you to try the steps below and check if it helps.

    Method 1: Try running the Fixit tool from the link below.

    Hardware devices do not work or are not detected in Windows:
    http://support.Microsoft.com/GP/hardware_device_problems

    Method 2: Try also to update the latest drivers for your device wireless using the link below.

    How to manage devices in Windows XP:

    http://support.Microsoft.com/kb/283658

    Hope this information is useful.

  • The Organizer database is damaged and I can not find Organizer90 to remove the window troubleshooting

    The Organizer database is damaged and I can not find Organizer90 to delete the Troubleshooting window.

    On Windows:
    Note: These instructions require you to locate hidden files. By default, Windows Explorer does not display hidden folders. To make visible the hidden folders, see Show hidden files, folders and file name extensions. Windows XP, Vista, Windows 7 (kb402324).
    • Close Acrobat.
    • In Windows Explorer, navigate to one of the following locations:

      • Windows XP: [C:\Documents and Settings\[your username] \Application Data\Adobe\Acrobat\9.0
      • Windows Vista and Windows 7: \AppData\LocalLow\Adobe\Acrobat\9.0[your username]C:\Users\
    • Delete Organizer90.
    • Restart the computer.
    • Open Acrobat.

    This thread has what seems to be the solution to this problem:

    Re: Damaged Organizer Database - Pro 9.0

  • Error during set up, can not find the path to internet

    At the end of the implementation for Photoshop, I get an error message that says that I can not find the path to the internet.  I changed my default browser to Internet Explorer for Chrome on the new PC, I bought today.  I want to finish the game!  Help, please.

    Log, activation, or connection errors. CS5.5 and later, Acrobat DC

    Mylenium

  • I continue to hear the chime exclamation in windows 7, but can not find where or why its carillon every bit of time

    today I heard this low chime from my speakers and can not understand why its happening.  I am running windows 7 and have checked my Kaspersky and unmarked notifications for DO NOT give sound advice.

    It happens every little bit, but can not find where the problem is.  I went to system sounds and it is the sound effect of exclamation.

    can someone help me please?

    Thank you
    the southern Belle

    Hello

    You will remember to do recent changes on the computer before this problem?

    I suggest you to check the status of the driver in Device Manager. Follow these steps:

    a. click Start, type Device Manager in the Start Search box and press ENTER.

    b. click continue. The Device Manager dialog box appears.

    c. If you are prompted for an administrator password or a confirmation, type the password, or click continue.

    d. in the device managementr check the status of the driver.

    You can also view the error messages display event logs. Follow the steps in the link:

    http://Windows.Microsoft.com/en-us/Windows7/open-Event-Viewer

  • my printer will not get the wireless signal and so my laptop can not find print, what should I do?

    How can I make the printer get the wireless signal?

    1 Microsoft do not have printers - so it would not be my first option to ask in the forums to help MS.

    2. we have even less likely to help when you do not tell us what printer, what operating system, what router wi - fi or anything!

    I suggest that you follow the instructions in your printer manual, with operating instructions of your wi - fi router to work things out.  You should connect the printer via a cable to the wireless installation.

    If stuck try the support forums on the Web site of the manufacturer of the printer with the forums on the website of the manufacturer of the router.

  • I downloaded the malware removal tool, but that it can not find on the list of programs, what good is it if I can't find it?

    I want to launch this tool, but can't find it, but still my Microsoft Download list says that it has been installed successfly in September 2011

    According to Noel, MSRT is run automatically when it is first downloaded from Windows Update.  If you want to run again for some reason, click Start, click Run, and then type the following in the Open box and click OK

    MRT.exe

    The results will be in a text file named C:\Windows\debug\MRT.log

    You can add switches: /? display information use
    / Q runs without user interface
    /N is only detect
    / F is full force sca
    / F: there did a full scan and automatically cleans infected files

    For more details, see http://en.wikipedia.org/wiki/Windows_Malicious_Software_Removal_Tool

    Unlike typical antivirus software, MSRT does not get updated virus signatures.  A new version, with the latest integrated virus information, is offered each month from Windows Update.

  • I bought adobe photoshop elements 13 and first 13 items, I downloaded photoshop but I can't download the first. I have the serial number, I check but I can not find where to try to download my product again. Can someone help me? Thank you

    I followed the instructions to download my products, but after downloading photoshop, I was able to download the elements first 13.

    My account view serial number and registration of the product, but I can't find where I can try it to donwnload again.  ???

    Please use the link below to download the application of elements first 13

    Adobe - download Adobe Premiere elements 13 free trial version | Adobe

    Download the demo on the link and enter the serial number. It will convert full version

  • How can I fix an error on start up: can not find the resource file?

    After that a false spypro virus was found and deleted I got the above error message when starting upwards.  How can I fix?

    Hello

    How to troubleshoot a problem by performing a clean boot in Windows Vista
    http://support.Microsoft.com/kb/929135
    How to check and change Vista startup programs
    http://www.Vistax64.com/tutorials/79612-startup-programs-enable-disable.html

    Autoruns - free - see what programs are configured to startup automatically when your system boots and you
    opening of session. Autoruns also shows you the full list of registry and file locations where applications can configure auto-
    start the settings.
    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902.aspx
    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • Error 737 D. I can't find a solution

    An update for Microsoft SQL server 2005 continually refuses to install. The solutions I've tried don't work

    Have what solutions you tried?

    Error code when you use Windows Update or Microsoft Update to install updates: "0x737D."
    http://support.Microsoft.com/kb/978597 [all OSS]
    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-Update-error-737D [Vista]
    http://Windows.Microsoft.com/en-us/Windows7/Windows-Update-error-737D [Win7]

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Error in dimension but can not find in dimesnions_exceptions - how to find erro

    Hello

    With the help of 11.2.0.3 on IBM Power Series 7 AIX

    and dbms_dimesnion.validate_dimension to see why shows compile_state error for a dimension.

    Me dimesnions-exceptions table but nothing after execution of this procedure.

    DBMS_DIMENSION. VALIDATE_DIMENSION ("DW. RETAILER_TRN_REPORT_TYPE', FALSE, FALSE, "my 1st example");

    Tried with all poss of the 2nd and 3rd parameter combinations.

    Any ideas?

    Thank you

    Yes, the dimension object can be dropped / recreated without impact on the data in the underlying table.
    If you build the dimension with OWB, then the better is the size of deployment with generated table OWB and as next - load data in the dimension with OWB mapping table.

  • Windows 8 100% use of the disc on 3 of my computers! Can not find a solution...

    Hello users of Windows 8.

    I'm running Windows 8 on 3 PCs (2 computers laptops, desktop 1) and I'm going to 100% usage of the disk on each of them. It started on one of my laptops, and then my desktop and now (started about 4 days ago) it happens also on my wife's cell phone. I have lived these forums and many others still looking for corrections of over and over again.

    I started having this problem at the beginning of 2013 on my Toshiba laptop. I waited patiently a correction (which is obviously never) until my office started having the same problem and I started to study the problem myself. I ran across countless people who have the same problem as I am. Some find corrections and some did not. Unfortunately have not yet found a solution to one of my computers running windows 8.

    My PC experience this problem at different times. My laptop experience this problem at startup, and which seems to be irregular intervals, throughout the use. My office has the problem, if I run a game or some programs (e.g. Microsoft Word, a CAD program, Firefox etc.).

    The problem that causes this on my desk is related to the SYSTEM in the Task Manager. I opened "Go to details" and he directs me to (NT Kernel System &) which in turn heading C:\Windows\System32\ntoskrnl.exe.

    The problem that causes this on my laptop is related to the SERVICE HOST: LOCAL SERVICE (usually restricted or sometimes without impersonation network). All lead me to a svchost.exe.

    These are the things that I tried on my laptop and desktop:

    1. update of the BIOS (already had updated versions)
    2. Update ALL my drivers
    3. my AV (Avast!) uninstalled and reinstalled
    4. uninstalled my AV (^ ^ ^) and I tried to use MSE
    5. uninstalled all AVs and tried to start the PC
    6 installed all Windows updates
    7. no installed VirtualBox
    8 disabled indexing files on the C: drive
    9. set to High Performance power management (not worked but would have not left like this on my laptop in any case)
    10 disabled the automatic updates
    11. off fragmented my records
    12 optimization of disk turned off
    13 clean my registry with CCleaner
    14 erased all the options in the Indexing Options
    15 Ran SFC/Scannow in a high CMD
    16 set my virtual memory to a custom size (twice the size of physical memory)
    17 disabled some services others have said are causing the problem. Disabled services:
    A. WSearch (Windows Search)
    B. WMPNetworkSvc (Windows Media Player Network Sharing Service)
    C. Defragsvc
    D. PLA
    E. Sysmain (Superfetch - did not work, but still once, even if that were the case I am not leaving this off service)
    18 start in Safe Mode. (No difference)
    19 run "Repair my computer" from the disc of Windows 8
    20 re-installed Windows 8 on my laptop
    21. much more "patches" the list could go on and. Those who I think are relevant mentioned above

    Computers, on which I tried these are:

    My laptop (Toshiba Satellite C75D, stock)
    My office (Custom, Phenom XII 940 BE CPU, Mobo from ASUS m3a78-em, XFX AMD Radeon GPU HD, 6 GB of ram DDR2 7790)

    I have not tried one of these "Bugs" on my wife's cell phone:

    ASUS X501A

    Any help with this would be greatly appreciated.

    I would also like to know why Microsoft has not yet solved this problem. How many people must experience this problem before you decide to do something. I saw people having this problem dating all the way back for 2012. I saw hundreds if not thousands of people having this problem and trying to find patches online, so I guess that many, many more are not of or don't know they have it.

    As customers, what do we have to do? Menace of a petitions signed by restless customers ready to bombard the BBB complaints if nothing is done? I would absolutely describe Windows 8 with this question like a defective product. Is there anything we can do to listen to Microsoft?

    * Yes, you're right.
    I stopped the automatic updates and deleted everything located on: "X:\Windows\SoftwareDistribution\Download."
    He has become much better. Then I disabled the windows swap files. (using the TuneUp Utilities) and even better. and then stopped defragmentation automatic of all readers and also done the Clean Boot and now the problem has disappeared, and the PC flies! Better than ever.

    I hope that the problem will not return again.

    Never go around everything related to windows updates, as I pushed him suddenly a button to use windows update to install a driver and the PC has been locked again and killed at the use of the disc.

    Here this will help you guys :) *.

    Sorry I forgot to mention: D!

    I think so... This o.o. worked... All of a sudden when I deleted the folder... My machine stopped the 99%... Now remains at 1% oo *? ....

    If you'll notice, you did some update Windows or your pc must have... For example, updates could try to settle... When I deleted the folder it took like 10 minutes to remove.

    After waiting like 10 side my drive keeps 2%, it does not go when iddle!

    It's a nice solution, thanks a lot!

    your welcome my friend.

    If the problem is back once again, try to disable the "superfetch" and "prefetch". It's more important that deleting those files and has the greatest effect on performance.

    You can use this guide here:

    http://www.tekrevue.com/Tip/disable-SuperFetch-prefetch-Windows-8/

  • When you try to receive updates get error code 80070005 "windows can not find updates."

    I have Vista Home Basic. I didn't update of microsoft since 07/12/11. Obviously that's when support for SP 1 ended.  But I have 2 SP.  I was on the support online chat with microsoft for 2 hrs and unresolved problem.  All of the suggestions.

    Please answer all the questions of diagnostic following by number in your very next answer (no need to quote this post):

    1. when your computer was brand new, you made or did you NOT download/run the McAfee Consumer products removal tool & restart Windows BEFORE installing Norton AntiVirus AND BEFORE you have installed the updated updated?  [YES/NO]

    2. have you updated Norton AntiVirus (NAV) over the years (for example, NAV 2009 > NAV 2010 > NAV 2011)?  [YES/NO]

    3 were charged for 2 hours with Support MS cat?  [YES/NO]

    4. in Firefox, Chrome or any other browser alternative never was installed?  [YES/NO]

    5 have you ever used a "registry cleaner" (e.g., Registry Mechanic;) System Mechanic; RegCure; Advanced SystemCare. PCTools optimizer; CCleaner)?<=this just="" a="" question,="" not="" a="" recommendation="" or="">

  • Mic input jack problems Inspiron 9300 - can not find a solution on the forum

    Help, please. I use my laptop to give daily talks and now the microphone does not work.

    Apparently, my mic input jack suddenly developed a problem - from one day to the next without warning. Is there a way to determine if it's hardware related. When you use Skype microphone is not available. When you run the test of the Control Panel, I get a few signals of green activity if I juggle the connector mic, partially from the Jack of the computer. If I plug the mic connector, as it has always worked and is supposed to be, there's no signal activity.

    What is the alternative now check and/or repair?

    Thank you.


  • What happened to "integrate Web page" interaction in CP9? I remember it was a huge thing in the version of CP8 but now I can not find.

    It is in the interactions > interactions of training > Web page. Now, he is not there for me. Is there another way to integrate a Web page. We were going to include a form in our courses in order to collect custom data that our LMS will report on. I remember this is something huge in the version of CP8 and even found some tutorials about this on YouTube. Maybe I'm missing it? We create a project inadmissible (I don't know if it matters, but I don't see why it would be).

    Look in the button bar > objects > Web object.

Maybe you are looking for

  • iPhone 5se

    I just got an iphone 5se and when I connect it to my mac I get a message that says: he can't use this phone because it doesn't have the latest version of itunes. Whats up with that? Please help thanks

  • Satellite P300 - 1-9-10 SD card reader code

    Hi all I have a new Toshiba P300 - 1 9, good for six months, and have just for the first time I tried an SD card into the slot of the multimedia card digital.The card does not appear in 'my computer '. In Device Manager it shows with the yellow sign

  • Error = 80070424

    I had problems in windows update, check the updates every time I get an error code 80070424 #. Could you please help me to solve this problem. Thank you.

  • problem with re-installing windows 7

    I had a hard disk crash.  Bought new hard drive retailer local (same HD that crashed) and installed.  Order the Lenovo recovery disks.  Tried to install via DVD-rom.  I got an error PXE.  I disabled the book of network from the bios.  I moved the DVD

  • Launch a browser app

    I want that my application that will be launched by the browser after the user downloads the soft... is there a way to do this in BB10. ? We have a scheme in the web page that the browser can use to launch the application...?