trigger to update a table after the use of commit_form;

Hi, I have a master detail shipping form where I enter the details and use commit_form; to save data... after that I want to update a column named as transit in deteil table
but the changes are not reflected.
PROCEDURE transit_update IS
BEGIN
       if :shipbill.billtype in ( 'Send it to site','Send it to staff','Send it to store','Send it to consumed ','send it to repair')
          then          
          update ship_1 set transit_qty = transact_qty
     where 
     billid =:shipbill.billid;


     end if ;
     
     if :shipbill.billtype in ('Received from staff','Received from site','Received from store','Received from STC')
          then          
          update ship_1 set transit_qty = 0
     where 
          billid =:shipbill.billid;
     

     end if ;
END;
I wrote it under the procedure and tried to call the block level under update post trigger but it doesn't...

Hello
Why not put the sub condition in PRE-INSERT/PRE-UPDATE (at the level of the blocks) of the retail block?

IF :shipbill.billtype IN ('Send it to site','Send it to staff','Send it to store','Send it to consumed ','send it to repair') THEN
  :ship_1.transit_qty = :ship_1.transact_qty;
ELSIF :shipbill.billtype IN ('Received from staff','Received from site','Received from store','Received from STC') THEN
  :ship_1.transit_qty = 0;
END IF;

If billtype is not simple text (filled in by the user) and then trying to find no matter what other condtion. To reduce misspellings error etc.

-Clément

Tags: Oracle Development

Similar Questions

  • DB trigger error - update even table in the script of the trigger

    Hi all
    I have a table tab1, whenever any update is done on this table on column col1 and col2 also needs to get the update. (These are related to user forms can be updated only col1 form frontend)
    So I created a trigger as follows.
    ----------------
    CREATE OR REPLACE TRIGGER tri1
    AFTER UPDATE
    ON tab1
    FOR EACH LINE
    WHERE (NEW.col1 = 'YES')
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    Tab1 SET col2 = 1 UPDATE
    WHERE transaction_id =: OLD.transaction_id;
    COMMIT;
    END;
    --------
    When there is no update on this table, I get following error. Please let me know if I'm missing something.
    ORA-00060: Deadlock detected while you wait resource
    ORA-06512: at "user1.tab1", line 5
    ORA-04088: error during execution of trigger 'user1.tab1 '.
    Please let me know if I'm not clear. Thank you

    Published by: DharV on August 23, 2011 05:17

    Your transaction_id is unique?

    If this is the case, then you could perhaps use AFTER UPDATE BEFORE UPDATE:

    CREATE OR REPLACE TRIGGER tri1
    BEFORE UPDATE
    ON tab1
    FOR EACH ROW
    WHEN (NEW.col1 = 'YES')
    BEGIN
       :NEW.col2 := 1;
    END;
    

    If your transaction_id is not unique - if you really want to update more than one line in tab1 - your update cannot update the same line that the trigger has responded, even with the use of an autonomous transaction. Then you could combine the BEFORE UPDATE trigger above with your own AFTER UPDATE, but then add ROWID! =: OLD. ROWID to where clause, but it would be a bad idea because some of your lines will be updated in a single transaction and others in another transaction.

    In general the autonomous transaction is not a great way to solve the problem of changing table within a trigger. I hope that you have a unique transaction_id and can do BEFORE the UPDATE - if it is then a better way is to save the update id in an overall picture in FOR EACH ROW triggers, and only then AFTER an UPDATE fire is NOT "for each line" update the list of saved IDs

  • Is it OK to delete the update number 2 after the new update has been entered IE number 6 of the same program?

    to delete the update number 2 after the new update has been entered IE number 6 of the same program

    original title: he is allowed to delete the previous updates of files

    Hi Carl,

    I suggest you go through this article to Java which can be useful.

    Why should I remove old versions of Java in my system?

    Removal of previous versions of the .net Framework is based on the applications that are running on the computer.

    For applications, if you have an application based on any .NET Framework on the computer, you cannot delete it since you have need to support the application runs correctly.

    .NET framework 3.5 SP1 includes .NET Framework 2.0 SP2 and 3.0 SP2. This means that .NET Framework 2.0 and 3.0 can not be deleted because they are the sine qua non of .NET Framework 3.5 SP1. If you have any application based on .NET Framework 3.5 SP1, please do not remove .NET 2.0 SP2, 3.0 SP2 and 3.5 SP1.

    I would also not to uninstall the security updates that are important for the security of your computer.

  • Creative cloud began the download of an update, but stopped after the download of 5 percent. Nothing works now and I can't access anything whatsoever. Help please!

    Creative cloud began the download of an update, but stopped after the download of 5 percent. Nothing works now and I can't access anything whatsoever. Help please!

    Please remove Cloud Creative app using:

    Install the cloud creative app - https://helpx.adobe.com/creative-cloud/help/install-apps.html

  • After the use of Seagate BACK, I've now lost 48 GB hard drive

    Hi after the use of seagate for BACK, I lost 48 GB of my hard disk, seagate response did not work?

    I found it earlier.

    You may try it and see what you told the utility:

    157734, http://www.PCWorld.com/downloads/file/FID, 4/description.html

  • My right click menu is missing after the use of security of Kaspersky application control settings.

    Right click menu disabled

    My right click menu is missing after the use of security of Kaspersky application control settings.

    My right click menu is missing after the use of security of Kaspersky application control settings.

    This tutorial will help?

    Context menu - enable or disable

    http://www.Vistax64.com/tutorials/140508-context-menu-enable-disable.html

    Option One is the easiest.

  • After the use of any USB device, I stopped the device that comes in the window telling me it is safe to remove the device and then my computer crashes I have to make a difficult start to resume what I was doing. It is on a Toshiba Satellite running Vista

    After the use of any USB device, I stopped the device that comes in the window telling me it is safe to remove the device and then my computer crashes I have to make a difficult start to resume what I was doing.  It is on a Toshiba Satellite running Vista

    Hello

    Follow these steps to remove corruption and missing/damaged file system repair or replacement.

    Start - type in the search box - find command top - RIGHT CLICK – RUN AS ADMIN

    sfc/scannow

    How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
    generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    Then, run checkdisk - schedule it to run at next boot, then apply OK your way out, then restart.

    How to run the check disk at startup in Vista
    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    -----------------------------------------------

    Then lets refresh the USB stack

    Control Panel - right CLICK on EVERYTHING - Serial USB controllers - Device Manager and UNINSTALL
    all except the category itself - REBOOT - it refreshes the drive and battery USB

    This KB shows XP how to and the method of Vista is identical
    http://support.Microsoft.com/kb/310575

    ----------------------------------------------

    If necessary try these two:

    Tips for solving problems of USB devices - and a Mr Fixit
    http://windowshelp.Microsoft.com/Windows/en-us/help/c39bd203-f729-47a4-8351-83291e13c8a81033.mspx#EGB

    Hardware devices not detected or not working - Mr. Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    ------------------------------------------------------------------------------------------

    If no joy, see Toshiba Support and/or their forums:

    Toshiba support and drivers
    http://www.CSD.Toshiba.com/cgi-bin/TAIS/support/JSP/home.jsp?NAV=download

    Toshiba Support Forums
    http://laptopforums.Toshiba.com/

    Contact Toshiba
    http://www.CSD.Toshiba.com/cgi-bin/TAIS/support/JSP/navShell.jsp?CF=su_contact

    I hope this helps and happy holidays!
    Rob - bicycle - Mark Twain said it is good.

  • where are my data after the use of Dell backup and recovery

    Three check marks displayed on a Dell backup and recovery, which, I suppose, finishing meant that my backup was successful (using Windows on a Dell Inspiron 8.1).  Where my data is sent to after the use of Dell backup and recovery?

    Click on the 02:22 mark of the video.

    www.YouTube.com/watch

  • Windows updates always installed after the return to a previous restore point?

    A restore point to bring victory 7professional. What will happen with the windows updates that came after the restore point?  Clicking on updates windows just always looking for updates, nothing happens. Updates are received before the restore point still installed?

    Windows update itself creates one in order to make them reversible. To resolve the issue, see updated:

    Windows 7 update problems? First read this.

    Best regards, VZ

  • blocks of Lightroom after the use of crops funktion. Export still works, but after you have selected the following image, lightroom must be inexplicable manually (no response from the program). environment: windows 7 adobe cc 2015

    blocks of ightroom after the use of crops funktion. Export still works, but after you have selected the following image, lightroom must be inexplicable manually (no response from the program). environment: windows 7 adobe cc 2015

    Turning off graphics acceleration. Go to preferences-> Performance tab and uncheck the box there.

  • After the use of helmet - no sound

    Everyone knows who after the use of the helmet, when it came out it is not through the speakers of Treo 680?

    I couldn't hear the phone ringing, incoming audio or ringtones playing. System sounds (beeps, etc.) seems to work. I have reinserted the helmet along with the helmet. I tried jiggling the plug and at the end of a few moments, has been able to recover the loudspeaker.

    There is a small switch inside the plug on your device, sometimes when a headphone is inserted and then picked up on this switch is not back to external sound more. The resolution is simply re - insert the plug and remove a few times to get the changeover to folding and the sound should return.

    Message relates to: Centro (Sprint)

  • What to do after the use of reflow

    Hello

    I started using reflow to achieve a responsive design. Although I'm not sure what comes after the use of reflow. Can I get html and css and I should edit them in Adobe Code and will be my Web site?

    Or will I get CSS Media Queries? Or do only CSS? Where can I get just CSS that is messy and that I need to change? How the reflow fits in my Photshop to Adobe Code workflow?

    I hope you guys understand my question, if not, please tell me and ill explain more clearly.

    Thank you

    Mark

    Hi Mark,

    I totally understand what you are looking for.  As of today, I have a couple of these questions that can help.

    First, the initial goal is to help designers to create sensitive compositions that can help receipts communicate their vision of design and behavior tailored to developers and stakeholders.  You might think that this as offering one more web friendly PSD.  We offer CSS extraction in reflow means you can incorporate, during development.  You can choose to use a variety of frames that we could not antisipate in code-gen, causing the code to come into conflict.  Because of these challenges, we take our time to learn the best way to repair as much as possible workflow.

    An alternative at the beginning was recently released by Terry Ryan to allow you to consume by reflow of the files on the media.  Check out his blog here - http://blog.terrenceryan.com/reflow-cleaner/

    Solve some of the challenges Terry stresses and work better product integrations is top of mind for our teams.  If all goes well, we will have more information for you in the coming months.

    Thanks for the post!

  • Layer merged after the use of convert to RGB to CMYK profile

    Hi all

    I'm converting a drawing printed in photoshop cs5 from RGB to CMYK. My layer merged after the use of convert to RGB to CMYK profile.

    After this, I save the file and close it, and I didn't have a backup of this file.

    Now please suggest how can I recover my all layers

    I don't need that my layers back...  Please help me

    Finally you all say there is no way back...

    because I checked flattened when I convert.

    No Way Back, I'll take care of it in the future

    Thank you all

  • Pass Pl/sql table in the USING clause in the EXECUTE IMMEDIATE statement

    Getting error when I try to pass the PL/SQL table in the USING clause in the EXECUTE IMMEDIATE statement:

    Declare
    result NUMBER;
    TYPE values_tab IS TABLE OF NUMBER INDEX OF directory;
    lv_tab values_tab;
    lv_exp varchar2 (300);
    lv_exec varchar2 (300);
    BEGIN
    lv_tab (1): = 5;
    lv_tab (2): = 48;
    lv_tab (3): = 7;
    lv_tab (4): = 6;
    lv_exp: = ': + b1: b2 + (: b3 *: b4)';
    lv_exec: = 'SELECT'. lv_exp | ' THE DOUBLE '.

    IMMEDIATE EXECUTION
    lv_exec
    IN
    result
    USING
    lv_tab;
    DBMS_OUTPUT. Put_line (result);

    END;
    /

    Error on line 1
    ORA-06550: line 20, column 12:
    PLS-00457: expressions must be SQL types
    ORA-06550: line 15, column 8:
    PL/SQL: Statement ignored


    I am trying to evaluate the expression ': + b1: b2 + (: b3 *: b4) "which is stored in the table. This table has different expressions (expressions about 300). I want to use the bind variable in the expression because each expression evaluated thousands of time may be more in some cases. If I use bind variable can he fill pool.

    Is there a way I can pass parameters with the HELP of (IN) dynamically instead of write "help lv_tab (1), lv_tab (2), lv_tab (3), lv_tab (4)? As number of change of the input parameters depend on the expression in the table.

    If it is possible please suggest any other ideas/approaches

    Help, please...

    Published by: satnam on June 11, 2009 11:50

    Well, you keep changing faster reqs that I can follow. In any case, assuming that N-th variable bind (left to right) corresponds to n-th collection item:

    Declare
        result NUMBER;
        lv_tab values_tab := values_tab();
        lv_exp varchar2(300);
        lv_exec varchar2(300);
        lv_i number := 0;
    BEGIN
        lv_tab.extend(4);
        lv_tab(1) := 5;
        lv_tab(2) := 48;
        lv_tab(3) := 7;
        lv_tab(4) := 6;
        lv_exp := ':5000135+:5403456+(:5900111*:5200456)';
        lv_exec := lv_exp;
        While regexp_like(lv_exec,':\d+') loop
          lv_i := lv_i + 1;
          lv_exec := REGEXP_REPLACE(lv_exec,':\d+',':b(' || lv_i || ')',1,1);
        end loop;
        lv_exec := 'BEGIN :a := ' || lv_exec || '; END;';
    DBMS_OUTPUT.PUT_LINE(lv_exec);
    EXECUTE IMMEDIATE lv_exec USING OUT result,IN lv_tab;
    DBMS_OUTPUT.PUT_LINE(result);
    END;
    /
    BEGIN :a := :b(1)+:b(2)+(:b(3)*:b(4)); END;
    95
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Steps the first time an UPDATE's questions after the start of the proceeding?

    The two steps are performed the first an UPDATE statement issues after the instance started? Choose two.

    A. creation of the syntactic tree of the statement.
    B. write the data blocks changed in the data file
    C. writing the changed data in the archived redo log files
    D. update the control file to indicate the last control point
    E. update the data file header to indicate the last control point
    F. read blocks in the database buffer cache if they are not already

    A & F.

Maybe you are looking for

  • NB 520 impossible to deactivate the loudspeaker during a helmet

    anyone with the same problem? When I plug my headphones still the speaker makes a sound.

  • expired ink cartridges

    As a small community group, we have received a grant to install a hp printer and a supply of cartridges for same. We have a stock of unopened cartridges the printer tells us are expired. At £35 we are reluctant to renew even as it would be more econo

  • Trash displayed always as complete.

    From 1 week I am really very surprised as to how well vista works for me. The only problem I encountered is: Trash displayed always as complete. Anyone facing this problem, if so, how have solved it? (without replacing the original icons of course) T

  • cleaning

    How can I take part my keyboardto give a thorough cleaning.  its quite sticky down there. I used to be able to remove the old. Thank you

  • How do I fax from vista Home premium 64-bit. I have a usb modem. __

    Before windows XP - I just hit print, select the fax printer and thenI could print.  The printer fax option does not appear.