Please help!!! about this damn triggers!?

Hi,
I wrote a trigger for a table in my database ,here is the code :
DECLARE
     NO_NUMBER NUMBER(1);
     pret_nou number(10);
     BEGIN
     IF UPDATING THEN
          SELECT COUNT(*) INTO pret_nou FROM OCT_ART_DIF WHERE ART_NO = :NEW.art_no;
          IF NO_NUMBER != 0 THEN
          select sell_pr into pret_nou from article where ART_NO = :NEW.art_no;
               update modif_pr set sell_pr=pret_nou where art_no= :NEW.art_no;
          END IF;
     end if;
end;
I have no compilation error but when it fire , the user who update the OCT_ART_DIF cannot save the data.
Can anyone tell me why ?
Thanks

I'm afraid you misunderstood my reply. I didn't mean you
personally couldn't select from that table, I meant Oracle does
not permit any trigger to do any select or DML on the table to
which the trigger belongs: you can't fire a trigger on SCOTT.EMP
that selects from SCOTT.EMP. It's the law.
The reason is simple: by definition the trigger is firing whilst
the table is in a state of flux - you're changing the table data,
that's why the trigger is firing. This means that a SELECT or
any DML on the triggering data cannot produce predictable or
consistent results.
For instance, what value should a query return :NEW.column_name
or :OLD.column_name?
Or consider your particular case: you're checking for the
existence of other records with a particular value. If you
insert three records with that value, each time the trigger fired
it would logically produce a different result -0, 1, 2. Is that
correct?
The answer to these questions is "It might be, it might not be."
Oracle resolves these tricky problems by saying: you can't do
that. It isn't pretty but at least it is consistent and
predictable.
If you really want to do this, then as someone suggested, you
need to hive it out to a PL/SQL procedure. You can use DBMS_JOB
to fire an updating routine in (say) 1 second's time.
rgds, APC

Similar Messages

  • I have problem with my I PHONE 4S  Always its time out then i must restart my I phone please any help about this case ??

    i have problem with my I PHONE 4S  Always its time out then i must restart my I phone please any help about this case ??

    Hello Pllumb,
    It sounds like you are unable to turn on Wi-Fi because the option is grayed out in Settings. Use these steps from the following article named:
    iOS: Wi-Fi settings grayed out or dim
    http://support.apple.com/kb/ts1559
    Restart your iOS device.
    Make sure that airplane mode is off by tapping Settings > Airplane Mode.
    Reset the network settings by tapping Settings > General > Reset > Reset Network Settings.
    This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings.
    Make sure that your device is using the latest software. To do so, connect your device to your computer and check for updates in iTunes.
    If you still can't turn Wi-Fi on, please contact Apple for support and service options. If you can turn Wi-Fi on but are experiencing other issues with Wi-Fi, please see these steps.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.

    search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.I have writen code on EH_ONSEARCH .as per below...what changess i need to do..and through partner function and adding the selection params please send the sample .
    code. partner funtction - ZRG DATA :
    DATA : lv_partner_fct type .
    types: begin of ty_resp,
           partner    type but000-partner,
           name_last  type but000-name_last,
           name_first type but000-name_first,
           mc_name1   type but000-mc_name1,
           mc_name2   type but000-mc_name2,
           end of ty_resp.
    DATA: lv_resp_bp type STANDARD TABLE OF ty_resp INITIAL SIZE 0,
           lw_resp_bp type ty_resp.
    IF lv_attr_name = 'Rgroup'.
    lr_entity->get_property_as_value( EXPORTING iv_attr_name = if_crm_srqm_uiu_const=>gc_attr_low
                                       IMPORTING ev_result = lv_low ).
    IF lv_low IS INITIAL.
    SELECT partner
           name_last
           name_first
           mc_name1
          mc_name2
    FROM but000 INTO table lv_resp_bp
    WHERE mc_name2 = lv_low and bu_group = '0010'.
    loop at lv_resp_bp into lw_resp_bp.
        lv_low = lw_resp_bp-mc_name2.
      lr_query_service2->add_selection_param( iv_attr_name = 'Rgroup'
                                                iv_sign = lv_sign
                                                iv_option = lv_option
                                                iv_low = lv_low
                                                iv_high = lv_high ).
      ENDLOOP.
    if lv_partner_fct = 'ZRG'.
      lr_entity = lr_iterator->get_next( ).
    CONTINUE.
    ENDIF.
    lv_attr_name = 'BU_PARTNER'.
    ENDIF.

    <b>You can acheive   this .... first by creating the search help exit    ... by  creating the maintaince  view   then   using it in the   Creation of the search help </b> ...
    see the link for attaching the view   to the serach help .
    <a href="http://">http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm</a>
    reward  points if it is usefull...
    Girish

  • When trying to verify the email address, I get the following message. Please help. This email address is already in use or you may already have an Apple ID associated with this email address. Please try again or sign in using your existing Apple ID.

    When trying to verify the email address, I get the following message. Please help. This email address is already in use or you may already have an Apple ID associated with this email address. Please try again or sign in using your existing Apple ID.

    Me too. I try to verify and i get the same message.
    I've created 3 alternate e-mail addresses and tried creating new accounts.
    Same Result!
    This is bullsh!t. How the **** can all 4 of my attempts result in the same freakin error???

  • I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    So just to be clear, when you say "just bought" how long ago was that? Is it on this new iPhone that you had pictures, texts, etc that you want? Were you backing up to iCloud or onto iTunes?
    This may not help for everything but if you go to iCloud.com and log in, are you able to find your pictures there?

  • Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy!

    Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy! It syncs 100+ songs, when I only want to sync 1! I'm running Itunes 11.3.1.2

    After having experienced similar problems and having it back to work, I have a few suggestions:
    - Try to find out if the syncing stops at a particular track or song. That might - out of the blue - have gotten corrupted in one way or another. Since that song will not be on the iPod, iTunes will try over and over to put it on and crash in one way or another;
    - reformat the iPod as described in the iTunes 9 crash-thread. It takes time (at first it seems to do nothing, but that is because the green bar is moving with very small steps);
    HTH

  • Please Help on this

    Hi Experts,
        I have schema which has to be implemented in SAP BI 7.0.Schema contains one Fact Table & three Dimension tables.It is snowflake schema.
    Assume Fact table as F & Dimension  tables as D1,D2,D3.The Schema is as follows.
    F---->D1--->D2---->D3
    Now i have created navigation attribute from D1 to D2 & D2 to D3 Then i have created a infocube having  facts & D1 attribute.
    So when i drag the infoObject from D1 having navigation attributes to D2 & from D2 to D3 iam unable to get D3 information.
    Please can any one suggest me how to get D3 level of information in report Or how to accesss the facts & D3 level information .
    Please Help on this
    Thanks & Regards
    Sameer Khan

    Hi Sameer,
    Your question is not clear.
    Regards,
    Sagar

  • I was trying to set Adobe Reader 11 as default PDF viewer on my client PCs, Please help me this. My server is windows 2012 R2 and client PCs are Windows 8.1

    I was trying to set Adobe Reader 11 as default PDF viewer on my client PCs, Please help me this. My server is windows 2012 R2 and client PCs are Windows 8.1

    Hi Krisis,
    I have found a forum where similar query was answered. Hope this helps.
    http://www.loginvsi.com/forum/support-v4/857-adobe-reader-xi-not-set-as-default-pdf-viewer -in-server-2012-r2-rds
    Regards,
    Anoop

  • HT5312 i forgot my secret question, please help me this problem. Thanks

    I forgot my secret question, please help me this problem. Thanks

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    And/or see the  More Like This  section on the right.

  • Trying to update photoshop and repeatedly get error code U44M1P7, can anyone please help resolve this?

    Trying to update photoshop and repeatedly get error code U44M1P7, can you please help resolve this?

    JJMack, Thanks for the info. Let this old man digest it and see if I can put the info into action. I'll give you a feedback. Thanks for your help in this matter. I am not a tech savvy person. 
    Rueben Rueben D. Olivas Home Ph:  1-671-969-2452
    Cell Ph:  1-671-747-2453La Luz Photography
    Email: [email protected]/Guam Firehouse Cook: http://guamfirehousecook.blogspot.com/BBQGuam: http://bbqguam.blogspot.com/My Photostream: http://ruebenolivas.megashot.net/photostream

  • Please help in this

    Hi
    Please help with this:
    How to know if string buffer doent contain anything:
    I am getting stringoutofbounds exception..
    StringBuffer myString=new StringBuffer(" ");
    if(myString.toString()!=" ")
         int i=myString.lastIndexOf(",");
         myString.deleteCharAt(i).toString());
         }

    If you want to compare the equivalence of two String datatypes, use the "equals()" method. The technique you are using, the equality operator '!=', will compare not the semantic value of the string representation, but rather the value of the object reference of that string. So in your example, ( myString.toString() != "" ) will always be true, even if the StringBuffer is instantiated with an empty string because the two sides of the operator refer to different objects.
    Use instead ..
    if ( !myString.toString().equals(""))

  • My Canon MP620 appears to be connected, yet every time I try to print something, it says error.  I have tried to unplug and track the error, but I cannot figure out why. Please help! this is such an inconvenience!

    My Canon MP620 appears to be connected, yet every time I try to print something, it says error.  I have tried to unplug and track the error, but I cannot figure out why. Please help! this is such an inconvenience!

    What Mac model? What Mac OS version?
    FYI, this forum is for Apple hardware made before 1999.

  • Hi. i updated my iphone 4s to iOS 7.0.4 but after that, wifi is not enabled. please help in this regard.

    Hi. i updated my iphone 4s to iOS 7.0.4 but after that, wifi is not enabled. please help in this regard.

    Apple has provided a useless workaround... [http://support.apple.com/kb/ts1559]
    Else the only option you have is to fight with the Apple Store "geniuses" to get a free replacement for out of warranty 4S devices. Or try a third party repair like iFixit. The wifi chip might cost you 60-80$ but it is better than paying Apple 200$.
    Overheating is the culprit in 4S devices. And its been getting worse with ever successive iOS 7 update. I think 7.0.4 was the final nail in the coffin.
    They are not getting my money anymore.. I've had iPhones every since they launched... but no more. Feels like a dead investment after facing this issue. I can never sell my iPhone 4S even if I want to. There have been cases where users just sold their 4S devices, the new owner updated to 7.0.4, wifi stopped working and the seller had to give a refund.
    I'm basically sitting on a 650$ white brick. Hmm... I wonder if white bricks sell higher than the standard red bricks
    Guess it's time for you to sign up this ongoing campaign [https://www.change.org/petitions/apple-to-get-apple-to-replace-all-units-affecte d-negatively-by-the-update-of-ios7-or-patch-an-update-that-will-remedy-the-issue s-many-loyal-customers-are-experiencing#share]
    TBH, I can't get a replacement because I am in India where 4S was never launched as an unlocked device and there are no Apple retail stores. Only resellers here like Vodafone/Reliance/Airtel. But if this petition can help the one who can take advantage of having retail stores around... why not? Sign up please. Thank You.

  • My iPhone 4 is going auto off and auto on. Could you please help on this please

    my iPhone 4 is going auto off and auto on. Could you please help on this please

    iOS 8.1.3 is the latest version. There's nothing to download.

  • SOMEONE PLEASE HELP ME THIS IS MY FIRST TIME DOING THIS MY IPOD IS DISABLED AND IT SAID CONNECT TO I TUNES I DID THAT AND ITS NOT WORKING HELP ME PLEASE AND THANK U

    SOMEONE PLEASE HELP ME THIS IS MY FIRST TIME DOING THIS MY IPOD IS DISABLED AND IT SAID CONNECT TO I TUNES I DID THAT AND ITS NOT WORKING HELP ME PLEASE AND THANK U

    Please turn off your caps lock.
    See http://support.apple.com/kb/HT1212.

Maybe you are looking for

  • Replacement case for my early 2011 17" macbook Pro

    Where is the best place to buy just the case for my laptop?? I checked out all of the websites I could but only found expensive full replacements.  I need just the skeleton because it is just cosmetic issues. 

  • Cross Company Code Incoming Payment Clearing

    Dear All Good day to you. I would be grateful if I could get advice on the following: Process: Company Code A is receiving Payment from Customer Z of Company Code B Present SAP Treatment F-02 Company Code A Bank Account is debited and Customer Z of C

  • Where is the file that was shared to media browser?

    I'm trying to delete stuff that I don't need. Where are the movie files that are shared to mediabrowser?

  • Whenever I do SAVE (ctrl + s) dreamweaver decides to do undo

    It's an ongoing problem with no apparent solution or reason to do so. I'm working on Dreamweaver CC and when going on several minutes into my project with CSS and HTML I tend to save my project via shortcuts (CTRL + S) but Dreamweaver decides, instea

  • What is posting key for debit note and credit note?

    Hi Gurus, May I know what is posting key for debit and credit note? My current sales debit and credit note having same posting key.  Where can I set this posting key? Sales debit note                dt      cr Sales credit note               dt