inserting data in a table when the record button

Hi all

I have a form that displays all fields in a table. It contains an adjustment column that has the value null by default and also an indicator of adjustment which is by default set to NO.

Now when the form is run the user has the option to add a value in this column adjustment and this value is stored in another table order_adjustment. Entries should be included in the adjustment table only when there is a change in the column setting and for the value that was changed
create table order_adjustement
( 
  adjustment_id number,
  oe_line_id number,
  adjustment_cnt number,
  created_by varchar2(100),
  created_date date,
  modified_by varchar2(100),
  modified_date date
)
I created a procedure in my form to insert my adjustment value
PROCEDURE p_adjustment IS
BEGIN
  insert into order_adjustement
  ( 
    adjustment_id     ,
    oe_line_id        ,
    adjustment_cnt    ,
    created_by        ,
    created_date      
  ) 
  values 
  (
    order_adjustment_seq.nextval,
    :oe_lines.oe_line_id,
    :oe_lines.adjusted_cnt,
    user,
    sysdate
   );
  
END;
I used relaxation during the new item on this field of setting instance but the problem is that his spare no not not the value that I'm passing it the first time but if I change these values, so these values are stored in the table.

Published by: Kevin CK on August 17, 2010 15:34

Hello

Kevin CK wrote:
Entries should be included in the adjustment table only when there is a change in the column setting and for the value that was changed

Well, I prefer to use the database, it will be more effective.
But if you want to use forms then try using the code below in the UPDATE to the block level.

IF (GET_ITEM_PROPERTY('adjustment_field_name',DATABASE_VALUE) != :adjustment_field_name OR
    (GET_ITEM_PROPERTY('adjustment_field_name',DATABASE_VALUE) IS NULL AND :adjustment_field_name IS NOT NULL))  THEN
     p_adjustment;  -- here procedure which will insert records...
END IF;

-Clément

Tags: Oracle Development

Similar Questions

  • Trying to update a table in a second table when the data are different

    Hello;
    I have a the same table in two databases. The database are connected with a DB link. I'm trying to update one table based on the data in the second table when the EMP_ID is but the name does not match.

    The table will look like:
    Table name: EMP
    EMP_ID
    LAST_NAME
    FIRST NAME
    MIDDLE_INITIAL

    My SQL is:
     
    update EMP TARGET 
        set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = ( 
            select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL 
            from EMP@OTHER_DB SOURCE where 
            TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID 
            and TARGET.LAST_NAME <> SOURCE.LAST_NAME); 
    This refers to a number of update of all lines not the bit I want.

    Any help would be great!

    Hello

    Sky13 wrote:
    Hello;
    I have a the same table in two databases. The database are connected with a DB link. I'm trying to update one table based on the data in the second table when the EMP_ID match

    Do you doctor_id?

    but the name does not match.

    The table will look like:
    Table name: EMP
    EMP_ID
    LAST_NAME
    FIRST NAME
    MIDDLE_INITIAL

    My SQL is:

    
    update EMP TARGET
    set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = (
    select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL
    from EMP@OTHER_DB SOURCE where
    TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID
    and TARGET.LAST_NAME <> SOURCE.LAST_NAME); 
    

    This refers to a number of update of all lines not the bit I want.

    Any help would be great!

    There is no WHERE clause in the UPDATE statement, so that each row in the target table will be changed.
    If you only want to change the lines that have a match in the source table, then add a WHERE clause (perhaps "WHERE EXISTS (...)) with a subquery miuch very similar to the one you already have), or use the MERGER instead of UPDATE.

    If you want to know, post CREATE TABLE and INSERT statements to recreate the tables they existed before the UPDATE and also post the contents of the table changed after the UPDATE.
    Always tell what version of Oracle you are using.

    Maybe you want something like this:
    {code}
    MERGE INTO the emp target
    WITH THE HELP OF)
    SELECT o.emp_id
    o.last_name
    o.last_name
    o.middle_initial
    OF emp@other_db o
    JOIN emp t ON o.emp_id = t.emp_id
    AND o.last_name! = t.last_name
    ) source
    WE (target.emp_id = source.emp_id
    WHEN MATCHED THEN UPDATE
    SET target.last_name = source.last_name
    target.first_name = source.first_name,
    target.middle_initial = source.middle_initial,
    ;
    {code}
    assuming that emp is unique, at least in other_db.

    It will work in Oracle 10 (and more). In Oracle 9, MERGER still requires a WHEN MATCHED clause, so add one if you must. No matter what he does; the subquery USE will only return matches.

    Published by: Frank Kulash, October 10, 2011 16:45

  • How to use several adf 12 shape and insert the form data in to table during the click on "submit" button

    How to use several adf 12 shape and insert the form data in to table during the click on "submit" button. Can we use several form from adf or not?

    Make sure that you dragged the VO based EO.

    Also make sure that the VO attributes based EO Updatable property.

    The query according to VO is used only to add LOV to the column of the original VO ModelId.

    See you soon

    AJ

  • Doubt about inserting data into a table

    Hi all, when I try to insert data into a table through an anonymous block, the pl/sql block runs successfully, but the data are not get inserted. Can someone please tell me where I am doing wrong?
    SQL> DECLARE
      2
      3  V_A NUMBER;
      4
      5  V_B NUMBER;
      6
      7  v_message varchar2(25);
      8
      9
     10  BEGIN
     11
     12
     13  select regal.regal_inv_landed_cost_seq.NEXTVAL into V_A from dual ;
     14
     15  select regal.regal_inv_landed_cost_seq.currval into V_B from dual ;
     16
     17  INSERT INTO rcv_transactions_interface
     18  (
     19               INTERFACE_TRANSACTION_ID,
     20               HEADER_INTERFACE_ID,
     21               GROUP_ID,
     22               TRANSACTION_TYPE,
     23               TRANSACTION_DATE,
     24               PROCESSING_STATUS_CODE,
     25               PROCESSING_MODE_CODE,
     26               TRANSACTION_STATUS_CODE,
     27               QUANTITY,
     28               LAST_UPDATE_DATE,
     29               LAST_UPDATED_BY,
     30               CREATION_DATE,
     31               CREATED_BY,
     32               RECEIPT_SOURCE_CODE,
     33               DESTINATION_TYPE_CODE,
     34               AUTO_TRANSACT_CODE,
     35               SOURCE_DOCUMENT_CODE,
     36               UNIT_OF_MEASURE,
     37               ITEM_ID,
     38               UOM_CODE,
     39               EMPLOYEE_ID,
     40               SHIPMENT_HEADER_ID,
     41               SHIPMENT_LINE_ID,
     42               TO_ORGANIZATION_ID,
     43               SUBINVENTORY,
     44               FROM_ORGANIZATION_ID,
     45               FROM_SUBINVENTORY
     46  )
     47
     48  SELECT
     49       regal.regal_inv_landed_cost_seq.nextval,      --Interface_transaction_
    id
     50       V_A,                                          --Header Interface ID
     51       V_B,                                          --Group ID
     52       'Ship',                                       --Transaction Type
     53       sysdate,                                      --Transaction Date
     54       'PENDING',                                    --Processing Status Code
    
     55       'BATCH',                                      --Processing Mode Code
     56       'PENDING',                                    --Transaction Status Cod
    e
     57       lc.quantity_received,                          --Quantity
     58       lc.last_update_date,                          --last update date
     59       lc.last_updated_by,                           --last updated by
     60       sysdate,                                      --creation date
     61       lc.created_by,                                --created by
     62       'INVENTORY',                                  --Receipt source Code
     63       'INVENTORY',                                  --Destination Type Code
     64       'DELIVER' ,                                    --AUT Transact Code
     65       'INVENTORY',                                  --Source Document Code
     66        msi.primary_uom_code ,                       --Unit Of Measure
     67        msi.inventory_item_id,                        --Item ID
     68        msi.primary_unit_of_measure,                  --UOM COde
     69        fnd.user_id,
     70        V_A,                                         --Shipment Header ID
     71        V_B,                                         --SHipment Line ID
     72        82,                                           --To Organization ID
     73        'Brooklyn',                                     --Sub Inventory ID
     74        81,                                            --From Organization
     75        'Vessel'                                       --From Subinventory
     76
     77    FROM
     78       regal.regal_inv_landed_cost_tab lc,
     79       fnd_user fnd,
     80       mtl_system_items msi
     81
     82    WHERE
     83       lc.organization_id = msi.organization_id
     84       AND  lc.inventory_item_id = msi.inventory_item_id
     85       AND  lc.created_by = fnd.created_by;
     86
     87  commit;
     88  v_message := SQL%ROWCOUNT;
     89  dbms_output.put_line('v_message');
     90  END;
     91  /
    v_message
    
    PL/SQL procedure successfully completed.
    SQL> select * from rcv_transactions_interface;
    
    no rows selected
    Thanks in advance!

    There is no problem with inserting data!
    Only there is no data! This means that your select statement retrieves no rows.
    You can see the output of your program (0). This means that there where no line in the result set.

    Please check the output of your tax return independently:

    SELECT
    --        regal.regal_inv_landed_cost_seq.nextval,      --Interface_transaction_id
     --       V_A,                                          --Header Interface ID
    --        V_B,                                          --Group ID
            'Ship',                                       --Transaction Type
            sysdate,                                      --Transaction Date
            'PENDING',                                    --Processing Status Code
            'BATCH',                                      --Processing Mode Code
            'PENDING',                                    --Transaction Status Code
            lc.quantity_received,                          --Quantity
            lc.last_update_date,                          --last update date
            lc.last_updated_by,                           --last updated by
            sysdate,                                      --creation date
            lc.created_by,                                --created by
            'INVENTORY',                                  --Receipt source Code
            'INVENTORY',                                  --Destination Type Code
            'DELIVER' ,                                    --AUT Transact Code
            'INVENTORY',                                  --Source Document Code
             msi.primary_uom_code ,                       --Unit Of Measure
             msi.inventory_item_id,                        --Item ID
             msi.primary_unit_of_measure,                  --UOM COde
             fnd.user_id,
      --       V_A,                                         --Shipment Header ID
    --         V_B,                                         --SHipment Line ID
             82,                                           --To Organization ID
             'Brooklyn',                                     --Sub Inventory ID
             81,                                            --From Organization
             'Vessel'                                       --From Subinventory
         FROM
            regal.regal_inv_landed_cost_tab lc,
            fnd_user fnd,
            mtl_system_items msi
         WHERE
            lc.organization_id = msi.organization_id
            AND  lc.inventory_item_id = msi.inventory_item_id
            AND  lc.created_by = fnd.created_by;
    

    Published by: hm on 13.10.2011 23:19

    I removed the references of the sequence and the variables V_A and YaeUb.
    BTW: Why do you want to include V_A and YaeUb in two different columns?

    The use of sequences in your code seems a bit strange to me. But this has nothing to do with your question.

  • Inserting data into one table to another table.

    Hi all

    I'm having a few problems when copying data from the 1 table to another table. I have a data 1 date in a table, and I want to insert data in a partition of the main table. As it is the dev database space by getting a problem. I don't have enough space that I can maintain the data for the same date in 2 places.

    Here every way possible in oracle this 1 table may be made partition in the other table. (Just a question).

    Please suggest me a way out and if possible should be fast that data are more than 50 million lines and size along 10 GB.

    Thank you

    Are the columns of your source table identical to that of the destination partitioned table?

    If so, you can create an empty partition in the partitioned table and then create a swap partition to swap the source with the new empty partition table.

  • a simple way to insert data in a table

    Hello

    I need to know in a simple way on how to transfer data from one table to the other...

    First xx_inv_tab1 table has three columns col1, col2, col3 and where as the second xx_inv_tab2 table has five columns col1, col2, col3, col4 col5.

    Here col2, col3, col4 are the same columns in table1 xx_inv_tab1...

    Now I want to transfer the first data in table in second table... first column of the second table holds a sequence, followed by the first three columns of table data and followed with col4 col5 which will contain NULL values...

    In my scenario, I have 70-75 columns in my first table that I want to move to the second table including three new columns (one is the sequence with two other null values)...

    All ideas, if do us it in a simpler way, saying rather insert into xx_inv_tab2 (col1, col2, col3, col75) values (seq, col1, col2,... col75, null, null)


    Help appreciated...

    Thank you

    Easy

    not tested

    insert into xx_inv_tab2 t2 (col1,col2,col3,col4)
    select yourSequence.nextval, t1.col1, t1.col2, t1.col3
    from xx_inv_tab1 t1
    ;
    

    Note that col5 must not be used, since you want to fill with a NULL value.

    Use excel or sql developer write you a list of the column names, if you are lazy to write all the columns of 75 by yourself.

    Which might also work:

    not tested

    insert into xx_inv_tab2 t2
    select yourSequence.nextval, t1.*, null
    from xx_inv_tab1 t1
    ;
    

    Published by: Sven w. on August 31, 2012 16:41

  • How can I insert data from another table into a table containing a timestamp column

    How you insert data from another table in a table if the target table contains a timestamp column. I tried to set the default value of GETDATE() column in the target table, but it does not work.


    I use MS SQL

    Sorry, I managed to get around this by inserting null as the value

  • You need to set the drive letter to the USB Ports front before any device has been inserted - that won't change when the device is connected. I have Windows XP Professional with Visual Studio 6 installed

    You need to set the drive letter to the USB Ports front before any device has been inserted - that won't change when the device is connected. I have Windows XP Professional with Visual Studio 6 installed. Thanks for your help

    diana73,

    First of all, make sure that you're connected Administrators account to do.

    How to change a drive letter to change an existing drive letter on a drive, on a partition, or a volume, follow these steps:

    1. Sign in as an administrator or as a member of the Administrators group.
    2. Click Start , click run and type compmgmt.msc .
    3. In the left pane, and then click disk management .
    4. Right click on the drive, the partition, the logical drive or volume that you want to assign a drive letter to and then click change drive letter and paths .
    5. Click change .
    6. Click assign the following drive letter if it is not already selected, click the drive letter that you want to use, and then click OK .
    7. Click Yes when you are prompted to confirm the drive letter change.

    The letter of the drive, partition, or volume that you specified is changed, and the new drive letter is displayed in the appropriate drive, partition, or volume in the disk management tool.

    Good luck! Please rate me upward if you find my post helpful. Thank you!

  • When I select edit then preference, the window is too large to be able to see the record button at the bottom to save my changes in the preferences.  How do I make the window smaller so I can't save my changes?

    When I select edit then preference, the window is too large to be able to see the record button at the bottom to save my changes in the preferences.  How do I make the window smaller so I can't save my changes?

    Your system meets the requirements of System. Dreamweaver?

    The problem can also be caused by the settings of your system as in

  • In the column of table when the values are grater that maximum linear axis it does not show the bar

    Hi guys,.

    In the column of table when the values are grater than there maximum linear axis it does not show the Bar.But I want to display the bar up to the maximum limit of the axis is linear without changing the limit max.

    Consider following the example:

    The values are 80 90 200 300

    and here is the result:

    Left: when I don't put maximum property of linear axis.

    Right: when I put in maximum property of linear axis to 200.

    Untitled.jpg

    Law 4th bar is not visible because the value of this bar is 300 which is excedding maxium. But I want the 4th bar to appear identical to 3 bar.

    How can I do this?

    Thanks in advance.

    Then you should change the value of Y to the maximum value.

    Another option, you should consider is changing the Render item column to reflect that the value is greater than the specified maximum value.

  • Cannot click on the record button in premiere Pro

    Hello

    I want to create voice-over in adobe pro cc first.

    The only thing is that I can not click on the button R ('record' button) when I chose my microphone.

    The microphone works on my mac and showing in the first. But nothing happens when I click on the record button.

    I'm using a Samson q2u usb microphone. Can someone help me?

    Thank you

    .. .thank you! That was exactly the problem that has been plaguing me.

    With the help of CC first edition, the solution was:

    • Select the sequence-> add titles
    • Add a new audio track - select the Mono type

    Everything works fine then.

  • Satellite C Touchpad Scrolls series / moves when the left button is pressed

    Hello

    Seem to have a problem with my touchpad.
    After about 2 weeks of normal operation, it now only rolls / moves when the left button is pressed.
    Had a quick look in the settings but can't seem to get anywhere.

    Any IDE?

    Thank you

    K

    It is not easy to say what the problem is here. Maybe this kind of behavior is the result of defective material.
    I recommend reinstalling the operating system using HARD drive recovery option and check again with the factory settings. If the same thing will happen again from the first moment he must be a bad operation of the equipment and in this case, you should contact the nearest Toshiba service provider.

    They can check, repair if necessary and all costs will be covered by the warranty.

  • The HP printer won't turn on or respond when the power button is pressed

    The HP printer won't turn on or respond when the power button is pressed

    The HP printer won't turn on or respond when the power button is pressed

  • printer do not wake off mode 'sleep' and does not turn off when the Start button / stop pressed or pushed.

    HP printer all-in-one B210a win 7 64 bit.

    no error message just don't wake up from power saving mode and does not turn off when the power button is pressed. must be disconnected and then turned back on. works fine until the power saving mode he did go to sleep then not answer the test print command or Toolbox controls.  power saving mode is turned off, but still goes to sleep.

    First, you will need to make sure that the printer is under warranty.  You can do it here.  So, if you are in warranty, you must contact HP at 1-800-474-6836 and the United States in computer science, international users click here.

  • Computer laptop screen goes black when the VGA cable is connected, but you press TV poster display correctly when the VGA button on the remote control.

    Computer laptop screen goes black when the VGA cable is connected, but you press TV poster display correctly when the VGA button on the remote control.   I need the laptop screen too.  It started just after years of correct use.

    Original title: VGA:

    In Panel > all items in the control panel > display > screen resolution you should be able to see the two devices / displays and be able to set options...

    http://Windows.Microsoft.com/en-us/Windows7/change-your-screen-resolution

Maybe you are looking for