How update the column in the table based on the value selected in apex4.1

Hi all
I have the following tables,
leave_type table,it has the following fields,
1.emp_name,
2.sick
3.casual
and it has the values as follows,
emp_name                  sick             casual
guru                           10                10
mishra                         10                10
leave_master table and it includes the following fields
1.emp_name,
2.leave_type
3.no_of_days
I have the form based on the table "leave_master"
Here, the leave_type has the LOV which includes.
sick and casual.

When the form is filled out and clicked on the button submit,
I need to update the column leave_type in table leave_type,
for example,.
if 
emp_name:guru
leave_type:sick
no_of_days:3
then I want to update the leave_type column,
sick sick = - no_of_days for the 'guru' of name
That is to say, ill = 10-3 = 7

then the leave_type of the table must be,
emp_name                       sick             casual
guru                                 7                10
mishra                              10               10
someone can such me what code or method I can use?
Thank you.

Published by: Gurujothi on May 24, 2012 21:54

Published by: Gurujothi on May 24, 2012 21:54

Try something like this...

BEGIN
IF: PXX_LEAVE_TYPE = "Sick" THEN
UPDATE LEAVE_TYPE
THE PATIENT VALUE = SICK -: PXX_NO_OF_DAYS
WHERE EMP_NAME =: PXX_EMP_NAME;
ON THE OTHER
UPDATE LEAVE_TYPE
DEFINE CASUAL = CASUAL -: PXX_NO_OF_DAYS
WHERE EMP_NAME =: PXX_EMP_NAME;
END IF;
COMMIT;
END;

Tags: Database

Similar Questions

  • How update the values in ValueChangeEvent...

    Hello world

    I use Jdeveloper 11.1.2.0.0.

    I have a scenario as follows. I have 2 fields like password and Confirmpassword.

    I wrote a ValueChangeListener for the password field to make some validations and I wrote an other ValueChangeListener for the field Confirmpassword inorder to compare values entered in the two fields.

    But here..., event in ValueChangeListener field Confirmpassword, iam cannot retrieve the password field value to compare.


    The reason is... ValueChangeListener is located in ApplyRequestPhase/ProcessValidationsPhase and updated the values in UpdateModelPhase values are so not updated and impossible to get in the ValueChangeListener event.


    In order to update the values of the tree of components in case of ValueChangeListener, I tried to use code below

    valueChangeEvent.getComponent () .processUpdates (FacesContext.getCurrentInstance ());


    But the values are not updated... Please suggest me to complete my scenario. Do what is necessary. Thanks in advance.


    Concerning

    Leprince















    Hello

    Change the scope of the bean to viewScope.

    Kind regards

  • ScriptUI: How update the values from Listbox? (CC2014)

    Is there a way to update item listbox that filled with the elements of the array JS. If I push more items in the table, how do I re - make in ScriptUI? Is there any way to do this.

    I know there are average just to add items to the listbox as in PDF of Peter Kahrel. But it's not so dynamic:

    var w = new Window ("dialog");
    var myList = w.add ("listbox", undefined, ["one", "two", "three"]);
    var b = w.add ("button", undefined, "Add");
    b.onClick = function () {myList.add ("item", "zero", 0)}
    w.show ();
    

    What would you say if I wan't to update the listbox when I changed my paintings, as below:

    // Create example array
    var testArr = ['item1', 'item2']
    $.writeln(testArr.length);
    
    startGUI();
    function startGUI() {
        
        // Window
        var win = new Window( "palette", script_name, undefined, { resizeable:true } );
        win.orientation = "column";
        win.alignChildren = ["fill", "fill"];
        
        // Listbox
        var myListbox = win.add ("listbox", undefined, testArr,  
            {  
            numberOfColumns: 1,  
            showHeaders: true,  
            columnTitles: ['Name']
        });
    
        // Add Item To Array
        var addItem = win.add("button", undefined, "Add Item");
        addItem.onClick = function() {   
            testArr.push ('item3');
            $.writeln(testArr.length);
        }  
    
        // Quit BTN
        win.quitBtn = win.add("button", undefined, "Close");
        win.quitBtn.onClick = function() {   
            win.close();   
        }
    
        win.show();
    }
    

    There may be some update on ScriptUI funtion. I tried to look for the solution without success. Any help?

    I've updated your own script to show how I removed the listbox

    I added a group to host the listbox control, the purpose of the group is to be used as a placeholder (to add the new listbox to the right place) and easily get the listbox to delete

    // listboxEditFromJSArray.jsx - Sakari Niittymaa
    // https://forums.adobe.com/message/6785515 
    
    //#target illustrator 
    
    // Create example array
    var testArr = ['item1', 'item2', 'item3']; 
    
    startGUI();
    function startGUI() { 
    
        // Main Window
        var win = new Window( "palette", "Test Listbox", undefined, { resizeable:true } );
        win.orientation = "column";
        win.alignChildren = ["fill", "fill"]; 
    
        // Listbox Group
        var grpListbox = win.add('group');
        grpListbox.alignChildren = ['fill', 'fill'];
    
        var myListbox = addListBox (grpListbox, testArr); 
    
        // add ListBox
      function addListBox(container, testArr) {
            var listbox = container.add("listbox", undefined, testArr,
                {
                numberOfColumns: 1,
                showHeaders: true,
                columnTitles: ['Name']
            });
    
            return listbox;
      }
    
        // BTN: Add Items To Array
        var addItem = win.add("button", undefined, "Add Item");
        addItem.onClick = function() {
            testArr.push ('item' + (testArr.length + 1));
            grpListbox.remove(grpListbox.children[0]);
            myListbox = addListBox (grpListbox, testArr);
            win.layout.layout(true);
            //updateListboxArray(myListbox);
            //$.writeln (testArr.length + "  " + myListbox.items.length);
        } 
    
        // BTN: Remove Selected
        var removeSelectedItems = win.add("button", undefined, "Remove Selected");
        removeSelectedItems.onClick = function() {
            // Remove selected listbox item from array
            testArr.splice( myListbox.selection.index, 1 );
            updateListboxArray(myListbox);
        } 
    
        // BTN: Clear Listbox
        var removeAllItems = win.add("button", undefined, "Clear Listbox");
        removeAllItems.onClick = function() {
            // Clear the array
            testArr = [];
            updateListboxArray(myListbox);
        } 
    
        // Update listbox items
        function updateListboxArray(listbox) { 
    
            // Clear listbox first
            listbox.removeAll(); 
    
            // Create new listbox items from array
            var i = 0;
            while (listbox.items.length < testArr.length) {
                listbox.add ("item", testArr[i]);
                i++;
            }
        } 
    
        // Quit BTN
        win.quitBtn = win.add("button", undefined, "Close");
        win.quitBtn.onClick = function() {
            win.close();
        } 
    
        // Window Settings
        win.onResizing = function () { this.layout.resize(); };
        win.onShow = function () { win.layout.resize(); };
        win.center();
        win.show();
    }
    
  • Selection of a column in a table based on a value

    Hello

    I'm stuck with a little problem here. I need to fill a column based on a value. I have an xml that looks like this to make it simple. (Don't worry, I'm not managing the status of a stock of candy ;-)))
    I have to build in rtf.

    <? XML version = "1.0" encoding = "UTF-8"? >
    -< ROWSET >
    -< ROW >
    < CANDY > Bubble gum < / CANDY >
    without SUGAR < > < / SUGAR >
    < / ROW >
    -< ROW >
    < CANDY > candy cinnamon < / CANDY >
    without SUGAR < > < / SUGAR >
    < / ROW >
    -< ROW >
    < CANDY > candy Gummy < / CANDY >
    < SUGAR > < / SUGAR >
    < / ROW >
    < / LINES >


    I have a table with two columns. I need to put on the left column candy SUGAR-free"and right the"tart ".
    Is there a condition to get there. Or what I have to do two table a column next to each other and adapt if condition in the for each.

    Best regards

    Olivier

    Have the same structure of table with two columns and each conditions in each of your columns.
    Say in column1: text to be printed
    Column2: text to be printed

    Hope this is what you want

  • How to update the value of a value in a table

    APEX - 4.1.0.00.32
    Version of DB - 10 g
    Web - OHS server architecture
    Browser - IE8
    Theme - 9

    Hello

    I have a tabular form and I want to update the value of a field using a process based on an add-on.

    the name of the column in the form of tables is (name of column P22_PROJECT_ID)

    The error I get is

    ERR-1002 unable to find point item ID 'P22_PROJECT_ID' in the application "103".

    Error unexpected, unable to find the name of the option at the page or application level.

    The field is questioned as

    Select pt.project_id P22_PROJECT_ID

    The code I'm trying to use in the process is

    : P22_PROJECT_ID: =: P10_PROJECT_ID;

    I also tried without the colon (P22_PROJECT_ID), but the application does not recognize.

    Any help would be appreciated.

    Thank you

    the tables for is on page 22?
    the project in page 10

    I think you go to page 22 page 10
    Create a new item in page 22 as p22_project_id
    Since 10 passes as a parameter the page p1o_project_id and set p22_project_id

    by default as p22_project_id

  • update the value of the column to the next value

    Hi all

    create table xxc_test (date of from_date, to_date date, amount, number incr_amount);

    Select 2014, 2015, 3000, the double null

    If suppose if input data in the incr_amount then let say 1000 I want to update the value with incr_amount column amount

    Select 2014, 2015, 4,000 of the double

    If not even though it is as

    Select 2014, 2015, 3000, the double null

    and must be updated to the year

    Note: I spend the year, amount,incr_amount manually (run-time)

    Post edited by: Rajesh123 Note added in the subect

    Hello

    : new.incr_amount: = 0; also use it in code.

    The condition " If : new.incr_amoun is > 0" then (sure fire or change the value only if the increment is positive. ).

    ,....

    ..

    end if;


    -Thank you

    Pavan Kumar N

  • Update the value Table B if table A the value of different

    Hi all
    I'm using Toad for Oracle and need assistance with a trigger. I have two tables tables A and B Table with some of the same fields. I want to only update the values in the array B, if the values in table A are not equal values in table B table A update. Don't update the record where the primary key of the Table equal to the foreign key in the Table B. I have a sample script below, I hope someone can give me an example, I can develop and test. Thanks for reading also.
    CREATE OR REPLACE TRIGGER AU_Table_A
    AFTER UPDATE ON Table_A
    FOR EACH ROW
    BEGIN
    If Table A :old.value != Table A :new.value
       then 
       update 
    --Update Table B value with Table A updated value
       Table B :old.value = Table A :new.value 
    where Table A primary key = Table B foreign key
    ............
    END IF;
    END;
    Published by: Nikki on December 6, 2011 07:50

    Hi Nikki,

    If I understand correctly, then maybe

    create or replace trigger au_table_a
      after update
      on table_a
      for each row
      when (old.value != new.value)
    begin
      update table_b
      set    table_b.value = :new.value
      where  table_b.foreign_key = :new.primary_key
          and table_b.value != :new.value;
    end au_table_a;
    /
    

    Note that the solution is not trying to handle NULL values. If you have NULL in to either A or B, we have to manage those specifically

    Concerning
    Peter

  • How to render components based on the value selected in a list of values

    Hello
    I created a form of the ADF. I have a drop down that is a list of values. I want to toggle certain fields based on the values selected in the menu drop-down. Could you please let me know how to do it in the ADF?

    Kind regards
    Murielle

    Hello

    It should work. It is important to note that in case you use a component selectOneChoice for category then the value returned by #{bindings. Category.inputValue}
    is the index of the selected value in the list and not the value auto. To get the value, you must use ' #{bindings. " Category.attributeValue}"in the disabled state.

    If the problem is no display of code in your page to take a look.

    Gabriel.

  • dynamically display title based on the value selected in the column picker

    Hi all
    Would it be possible to display the title of the dynamic report based on the value selected in the column picker. Suppose I have two State of the column and region. When I choose the status in the column picker the title of the report will show 'Summary of the situation' when I'll choose the region then the title will change to "summary of the region. Please help me...

    Hello

    Check your mail before I send the entire process with screenshots.

    Concerning

    NGO

  • Update the value of DataGrid

    I have a request - it can be found at http://reactorsoft.ath.CX/projects/Cygnus_v1/Cygnus_v1.html If a reference is required.

    In this application, I have a DataGrid. What I want to do update the rightmost 3 columns based on the data entered in the Act. Column of gains. Ideally, this will be row-by-row.

    The problem I encounter is that the value in the DataGrid control is not updated quickly enough when the itemEditEnd event is raised. If I return to this line and update the value is entered, the old value will be recovered. How can I work around this problem?

    In addition, another problem I encounter is that the triggerEvent itemEndEdit event value is not give me a value. This is supposed to tell me if the installation has ended due to a mouse event or keyboard. It is also essential to what I'm trying to accomplish.

    Can anyone provide me with an isight in this? It will be very much appreciated.

    A tip: use the method callLater to ensure that the dataProvider has been updated:


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete =" init () ">"
       
            Import mx.events.DataGridEvent;
    Import mx.collections.ArrayCollection;
               
    [Bindable]
    private var dp:ArrayCollection;
               
    private function init (): void
    {
    var da: Array = [{id: 1, amt: 0, c1:0, c2:0}, {id: amt 2: 0, c1:0, c2:0}];
    DP = new ArrayCollection (da);
    }
               
    private void calc(evt:DataGridEvent):void
    {
    var currObject:Object = [evt.rowIndex] dp;
    currObject.c1 = currObject.amt * 2;
    currObject.c2 = currObject.amt * 1.5;
    }
    ]]>
       

       
           
               
               
               
               
           

       

       

    Hope this helps,

    Dany

  • Oracle apex 5.0: not update the values in the Collection.

    Hello again,

    I have a problem in IR where content comes from the collection query.

    Now the question is when I update the value of the column in the report and click on the custom button, that it will update the value of collection and insert the updated values of the collection member in another table that works well according to my condition, but when I will apply to any word in the search bar (say books in order not to update the values of books) and tries to update the value as a result of research above requirement does not work I mean the collection is not updated. Apex. Oracle.com

    testdump/developer/Office

    All of the Suggestions!

    Thank you

    Pranav.

    Pranav.Shah wrote:

    I have a problem in IR where content comes from the collection query.

    Now the question is when I update the value of the column in the report and click on the custom button, that it will update the value of collection and insert the updated values of the collection member in another table that works well according to my condition, but when I will apply to any word in the search bar (say books in order not to update the values of books) and tries to update the value as a result of research above requirement does not work I mean the collection is not updated. Apex. Oracle.com

    testdump/developer/Office

    The "coll update" process fails with a ORA-01403: no data found error. This happens in line 11 because of the access attempt to the wwv_flow.g_f01 using the variable array subscript c who has been incremented beyond the size of the table, which is now smaller because of the IR filter applied.

    begin declare
      c pls_integer := 0;
    begin
    for c1 in (
      select seq_id,c001 from apex_collections
      where collection_name = 'MATRIX2'
      ) loop
    c:=c+1;
    apex_debug.message(c);
      apex_collection.update_member_attribute (p_collection_name=> 'MATRIX2',
      p_seq=> c1.seq_id,p_attr_number =>'2',p_attr_value=>wwv_flow.g_f01(c));
    
    end loop;
    end;
    end;
    

    I agree with fondant tabular forms on interactive reports, but you can meet your requirement as follows. In your application, see page 2.

    1 Add a column of form element hidden IR containing the sequence number of collection:

    select
        c001 col1
      , apex_item.text(2, c002) col2
      , apex_item.hidden(1, seq_id) seq
    from
        apex_collections
    where
        collection_name = 'MATRIX2'
    

    2 place the question of the hidden form in the report using the COL1 Expression HTML attribute:

    #COL1##SEQ#
    

    3. change submit to the process if it is driven by the subject table, not the existing collection:

    begin
    
      for i in 1..apex_application.g_f01.count
      loop
        apex_collection.update_member_attribute(
            p_collection_name=> 'MATRIX2'
          , p_seq=> apex_application.g_f01(i)
          , p_attr_number => '2'
          , p_attr_value=> apex_application.g_f02(i));
      end loop;
    
    end;
    
  • Update multiple columns from multiple tables in a single UPDATE request

    Hello

    I'm trying to figure if I'm heading in the right direction.

    I want to update multiple columns from multiple tables in a single UPDATE request. Also, I would like to update multiple columns in a table from the tables.

    Scenario 1

    UPDATE Table2, Table 3
    SET T2.Column1 = T1.Column1 
    ,T2.Column2 = T1.Column2
    ,T3.Column2 = T1.Column2
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T1.id = T2.id
    and T1.id = T3.id
    
    

    Scenario 2

    UPDATE Table3
    SET T3.Column1 = T1.Column1 
    T3.Column2 = T1.Column2
    ,T3.Column3 = T2.Column3
    ,T3.Column4 = T2.Column4
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T3.id = T1.id
    and T3.id = T2.id
    
    

    Hello

    For scenario 1, you must write separate instructions UPDATE table2 and table3.

    To guard against someone else change one of these tables while you act so you can copy all relevant data in a global temporary table and update this global temporary table table3.

    ENGAGE only when two tables have been changed.

    You can write a procedure or an INSTEAD OF trigger to do all this.

    For scenario 2, you can reference many tables that you need when new table3.  It might be more efficient and simpler to use the MERGER rather than UPDATED.  For example:

    MERGE INTO table3 dst

    WITH THE HELP OF)

    SELECT t1.id

    t1.column1

    t1.column2

    t2.column3

    t2.column4

    FROM table1 t1

    JOIN table2 t2 ON t1.id = t2.id

    )             src

    WE (dst.id = src_id

    WHEN MATCHED THEN UPDATE

    SET dst.column1 = src.column1

    dst.column2 = src.column2,

    dst.column3 = src.column3,

    dst.column4 = src.column4,

    ;

  • Need to update a column in a table to another table

    I followed two tables
    () PP_TAX
    BAN NUMBER (9),
    FEATURE_CODE TANK (6 BYTES),
    FTR_REVENUE_CODE TANK (3 BYTES),
    TAX_CALC_METHOD CHAR (1)
    )
    () CHARGE_INFO
    FEATURE_CODE TANK (6 BYTES),
    FTR_REVENUE_CODE TANK (3 BYTES),
    TAX_CALC_METHOD CHAR (1)
    )

    First PP_TAX table is a temporary table. I inserted the values of the 3 columns (BAN, feature_code and FTR_REVENUE_CODE). And now I want to update this table TAX_CALC_METHOD column by using the CHARGE_INFO table.
    I need to compare feature_code & FTR_REVENUE_CODE of the columns of the tables, and update the values in the PP_TAX table.
    Kindly help
    Paragraphs

    Welcome to the forum.

    Are you like?

    CREATE TABLE PP_TAX (
    BAN NUMBER(9),
    FEATURE_CODE CHAR(6 BYTE),
    FTR_REVENUE_CODE CHAR(3 BYTE),
    TAX_CALC_METHOD CHAR(1)
    );
    CREATE TABLE CHARGE_INFO(
    FEATURE_CODE CHAR(6 BYTE),
    FTR_REVENUE_CODE CHAR(3 BYTE),
    TAX_CALC_METHOD CHAR(1));
    
    INSERT INTO  PP_TAX(BAN, FEATURE_CODE, FTR_REVENUE_CODE)
    VALUES (1,'AAAAAA','BBB');
    
    INSERT INTO  CHARGE_INFO(FEATURE_CODE, FTR_REVENUE_CODE,TAX_CALC_METHOD )
    VALUES ('AAAAAA','BBB','U');
    
    COMMIT;
    
    UPDATE PP_TAX P SET P.TAX_CALC_METHOD = (SELECT TAX_CALC_METHOD FROM CHARGE_INFO CC
                                              WHERE CC.FEATURE_CODE=P.FEATURE_CODE
                                                AND P.FTR_REVENUE_CODE=CC.FTR_REVENUE_CODE)
    
    COMMIT; 
    
    select *  from  PP_TAX;
                               
    
  • Select cursor for update: multiple columns of different tables

    Hello

    I have two tables test1 and test2. I want to udpate the column (DEPT_DSCR) from the TEST1 and TEST2 using select for update and current tables of the... with the cursor.

    I have a code drafted as follows:
    DECLARE
    v_mydept1 TEST1. TYPE % DEPT_CD;
    v_mydept2 TEST2. TYPE % DEPT_CD;
    CURSOR C1 IS SELECT TEST1. DEPT_CD, TEST2. DEPT_CD OF TEST1, TEST2 WHERE TEST1. DEPT_CD = TEST2. DEPT_CD AND TEST1. DEPT_CD IS 'AA' FOR THE UPDATE OF TEST1. DEPT_DSCR, TEST2. DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1, v_mydept2;
    WHEN EXIT C1% NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR IS "PLSQL1" WHERE CURRENT OF C1;.
    SETTING A DAY TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1.
    END LOOP;
    COMMIT;
    END;

    The code above when it is run, declares that it runs successfully. But it does not update the columns you want [DEPT_DSCR].

    It works only when we want to update one or more columns of the same table... i. e by providing these columns after ' to UPDATE THE.
    I don't know what exactly is the problem when you want to update several columns of different tables.

    Can someone help me on this?

    user12944938 wrote:
    But it's more the notion of compensation and understanding.

    See the link below:
    http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a97269/pc_06sql.htm

    See the section RESTRICTION in the link above.

    Twinkle

  • Help! Try to update the values of Member - but does not (completely).

    We are trying to resolve a calculation in the middle of the update of business cycle. There is a push to update existing values for an account specific forecast time scenario.

    Essentially, we want to update the value of forecast current account 56400 to 0.33 * ("56100" + "56110" + "56300" + "56310" + "56320").

    The solution is to make sure only rest of the current year, Apr - Dec, updated forecasts to date.

    Currently the rule runs, but handful of values is never get updates - I'm not doing correctly?

    relatively small cube BSO, Account (dense).

    Here is the rule of this task running

    SET CACHE HIGH;

    FIX (& those 'Forecasts', 'the current iteration","F_00000");

    "56400")

    IF (@ISMBR (& NextMonth: "Dec"));

    0.33 * ("56100" + "56110" + "56300" + "56310" + "56320");

    ENDIF ;)

    ENDFIX;

    -followed by a calc all

    I expect to update all occurrences 56400 in the fix above...

    Thanks in advance!

    Himanshu-

    You probably need...

    UPDATECALC OFF SET;

    .. Smart calc or .in there will prevent 'own' blocks to be recalculated.

Maybe you are looking for

  • Tecra Z50-A-180 does not start using the new SSD OCZ Vertex 460

    Hello I bought an SSD OCZ Vertex 460 for Tecra Z50-A-180 but the system only started only not with this device. BIOS detect SSD but not find any system start-up. I cloned the old SSD HARD drive, but the system does not boot with SSD. I installed the

  • 5th generation ipod continuous restart

    Three days ago, my ipod started to disconnect, and then reconnect with wifi, even if my wifi worked very well. Then when it started disconnecting, it began to restart itself (sometimes there will be purple on my screen scratches when this happens)...

  • What is the fax showed only in the process task manager

    Hi all Please can I know how to find a Fax/dial-up process in the process task manager?  I would like to be able to put end after a fax was sent so that I can send another. I use the installation of fax in Windows XP. Thank you in advance. Emmanuel

  • Files lost due to the recent acquisition of PC Booster

    Last night, I purchased the above product.  As indicated that I gave up reluctantly, in control of my computer to your technician.  He tried to help me.  When he asked that make sure everything was working.  I found ALL my pictures, videos, bank file

  • Pavilion 15-ab063tx: 15-ab063tx Pavilion network controller driver problem

    Hello I just bought a new 15-ab063tx Pavilion and after format, I have a wireless network connection problem. For the network local network it works well but I can't find the wireless network adapter. On the device he received the error this network