Update all rows in a View Column via one Apex Form field

Appreciate any helpful answers to this query.
I have an Apex App (4.x) where I have a view: PRICE_MODEL_CRA_V
In the view, I have the following applicable columns:
COUNTRY
GRADE
SALARY
In the form I have the following fields
:P16_COUNTRY (DROPDOWN)
:P16_GRADE (DROPDOWN)
:P16_SALARY (Number)
In my app, I have a form with an Update button. I am simply trying to get Apex to update all rows in the salaray column in the view, where the country and grade match.
I've the following code for the Update button:
UPDATE PRICE_MODEL_CRA_V
SET SALARY = :P16_SALARY
WHERE COUNTRY = :P16_COUNTRY
AND GRADE = :P16_GRADE
The option I have chosen in condition type is:
Value of Item / Column expression is NOT Null (as there are values in the column)
Also tried SQL Expression and it does not like..says that there is No Expression.
Thanks again if anyone can help :)

Hi,
Sorry I realize now that piece of information was not well supported.
If I choose SQL Expression for Condition Type in my Form Page and I try to Apply Changes
Apex says this..
•Failed to parse SQL query!
ORA-00936: missing expression
I was assuming that I need to have the colon for the items in the form where I am wanting Apex to grab the values entered by the user. I tried them without the colons with the SQL Expression condition and same result.
UPDATE PRICE_MODEL_CRA_V
SET SALARY = P16_SALARY
WHERE COUNTRY = P16_COUNTRY
AND GRADE = P16_GRADE
I did put 1-1/0 in my expression field and applied changes and then tried ot submit the form and it does not produce an error, so perhaps it is not being called? Where would I start with troubleshooting that?
Thanks,

Similar Messages

  • Deadlock when updating different rows on a single table with one clustered index

    Deadlock when updating different rows on a single table with one clustered index. Can anyone explain why?
    <event name="xml_deadlock_report" package="sqlserver" timestamp="2014-07-30T06:12:17.839Z">
      <data name="xml_report">
        <value>
          <deadlock>
            <victim-list>
              <victimProcess id="process1209f498" />
            </victim-list>
            <process-list>
              <process id="process1209f498" taskpriority="0" logused="1260" waitresource="KEY: 8:72057654588604416 (8ceb12026762)" waittime="1396" ownerId="1145783115" transactionname="implicit_transaction"
    lasttranstarted="2014-07-30T02:12:16.430" XDES="0x3a2daa538" lockMode="X" schedulerid="46" kpid="7868" status="suspended" spid="262" sbid="0" ecid="0" priority="0"
    trancount="2" lastbatchstarted="2014-07-30T02:12:16.440" lastbatchcompleted="2014-07-30T02:12:16.437" lastattention="1900-01-01T00:00:00.437" clientapp="Internet Information Services" hostname="CHTWEB-CH2-11P"
    hostpid="12776" loginname="chatuser" isolationlevel="read uncommitted (1)" xactid="1145783115" currentdb="8" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
               <inputbuf>
    UPDATE analyst_monitor SET cam_status = N'4', cam_event_data = N'sales1', cam_event_time = current_timestamp , cam_modified_time = current_timestamp , cam_room = '' WHERE cam_analyst_name=N'ABCD' AND cam_window= 2   </inputbuf>
              </process>
              <process id="process9cba188" taskpriority="0" logused="2084" waitresource="KEY: 8:72057654588604416 (2280b457674a)" waittime="1397" ownerId="1145783104" transactionname="implicit_transaction"
    lasttranstarted="2014-07-30T02:12:16.427" XDES="0x909616d28" lockMode="X" schedulerid="23" kpid="8704" status="suspended" spid="155" sbid="0" ecid="0" priority="0"
    trancount="2" lastbatchstarted="2014-07-30T02:12:16.440" lastbatchcompleted="2014-07-30T02:12:16.437" lastattention="1900-01-01T00:00:00.437" clientapp="Internet Information Services" hostname="CHTWEB-CH2-11P"
    hostpid="12776" loginname="chatuser" isolationlevel="read uncommitted (1)" xactid="1145783104" currentdb="8" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
                <inputbuf>
    UPDATE analyst_monitor SET cam_status = N'4', cam_event_data = N'sales2', cam_event_time = current_timestamp , cam_modified_time = current_timestamp , cam_room = '' WHERE cam_analyst_name=N'12345' AND cam_window= 1   </inputbuf>
              </process>
            </process-list>
            <resource-list>
              <keylock hobtid="72057654588604416" dbid="8" objectname="CHAT.dbo.analyst_monitor" indexname="IX_Clust_scam_an_name_window" id="lock4befe1100" mode="X" associatedObjectId="72057654588604416">
                <owner-list>
                  <owner id="process9cba188" mode="X" />
                </owner-list>
                <waiter-list>
                  <waiter id="process1209f498" mode="X" requestType="wait" />
                </waiter-list>
              </keylock>
              <keylock hobtid="72057654588604416" dbid="8" objectname="CHAT.dbo.analyst_monitor" indexname="IX_Clust_scam_an_name_window" id="lock18ee1ab00" mode="X" associatedObjectId="72057654588604416">
                <owner-list>
                  <owner id="process1209f498" mode="X" />
                </owner-list>
                <waiter-list>
                  <waiter id="process9cba188" mode="X" requestType="wait" />
                </waiter-list>
              </keylock>
            </resource-list>
          </deadlock>
        </value>
      </data>
    </event>

    To be honest, I don't think the transaction is necessary, but the developers put it there anyway. The select statement will put the result cam_status
    into a variable, and then depends on its value, it will decide whether to execute the second update statement or not. I still can't upload the screen-shot, because it says it needs to verify my account at first. No clue at all. But it is very simple, just
    like:
    Clustered Index Update
    [analyst_monitor].[IX_Clust_scam_an_name_window]
    cost: 100%
    By the way, for some reason, I can't find the object based on the associatedObjectId listed in the XML
    <keylock hobtid="72057654588604416" dbid="8" objectname="CHAT.dbo.analyst_monitor"
    indexname="IX_Clust_scam_an_name_window" id="lock4befe1100" mode="X" associatedObjectId="72057654588604416">
    For example: 
    SELECT * FROM sys.partition WHERE hobt_id = 72057654588604416
    This return nothing. Not sure why.

  • Update all rows in a table which has 8-10 million rows take for ever

    Hi All,
    Greetings!
    I have to update 8million rows on a table. Basically have to reset the batch_id with the current batch number. it contains 8-10 million rows and i have tried with bulk update and then also it takes long time. below is the table structure
    sales_stg (it has composite key of product,upc and market)
    =======
    product_id
    upc
    market_id
    batch_id
    process_status
    I have to update batch_id,process_status to current batch_id (a number) and process_status as zero. I have to update all the rows with these values for batch_id = 0.
    I tried bulk update an it takes more than 2hrs to do. (I limit the update to 1000).
    Any help in this regard.
    Naveen.

    The fastest way will probably be to not use a select loop but a direct update like in William's example. The main downside is if you do too many rows you risk filling up your rollback/undo; to keep things as simple as possible I wouldn't do batching except for this. Also, we did some insert timings a few years ago on 9iR1 and found that the performance curve on frequent commits started to level off after 4K rows (fewer commits were still better) so you could see how performance improves by performing fewer commits if that's an issue.
    The other thing you could consider if you have the license is using the parallel query option.

  • Update multiple rows based on two columns in same row

    I have a 1000 rows in a table I would like to update with a unique value. This unique value is a cocatenation of two columns in teh same row.
    Each row has a (i) date and a (ii) time and a (iii) date_time column. I would like to update the date_time (iii) column with a cocatenation of the (i) date and (ii) time columns.
    I know how I would update a single row but how can I update multiple rows with a cocatenation of each of the two columns - i.e put a different value into the date_time column for each row?

    this?
    update table tab_name
    set date_time =date||time
    where your_condition

  • Problem to update 16 rows, it updates all rows in table

    I tried to update 16 rows with AL as divion name with the script as below:
    Update wire_center a set a.wg_id='63'
    where EXISTS (select b.div_name from wire_center a, division b, district c, ns_workgroups d
    where B.DIV_NAME='AL' AND a.dis_id=c.dis_id and b.div_id=c.div_id and d.wg_id=a.wg_id );
    When I run it, it updates all the rows in the table.
    However when I run the select subquery, it returns 16 rows.
    It seems where EXISTS is the problem. if I take exists out, it gave me ora-00936 error.
    How to fix it? Please need urgent help. db is 10g.
    Thanks in advance.

    If I understand correctly what you want, you should not include wire_center again in the second select (in your exists clause).
    The second select has no relation to the table you are updating, so because the second select returns 16 rows, the exists will always be true. For every row. So every row will be updated.
    Instead of
    Update wire_center a set a.wg_id='63'
    where EXISTS (select b.div_name from wire_center a, division b, district c, ns_workgroups d
    where B.DIV_NAME='AL' AND a.dis_id=c.dis_id and b.div_id=c.div_id and d.wg_id=a.wg_id );try this:
    Update wire_center a set a.wg_id='63'
    where EXISTS (select b.div_name from division b, district c, ns_workgroups d
    where B.DIV_NAME='AL' AND a.dis_id=c.dis_id and b.div_id=c.div_id and d.wg_id=a.wg_id );Edited by: theoa on 29-dec-2010 14:27

  • Data Load Wizard not Inserting/Updating all rows

    Hello,
    I am able to run through the whole Data Load Wizard without any problems. It reports that it successfully inserted/updated all the rows, but when I look in the table, I find a few rows that were not updated correctly. Of the entries I've identified that don't get inserted/updated properly, I've noticed they are the same rows that I was having issues with earlier. The issue was a number format error, which I solved by providing an explicit number format.
    Is it possible that the false inserts/updates might still be tied to the number format, or are there other reasons why the data load is failing on only some rows.
    Thanks,
    Brian
    Edited by: 881159 on Mar 14, 2012 5:05 PM

    Hi Brian,
    I am not aware of the situation where you get false results. However, there were some issues with number/date formats that sometime were not properly parsed, and this has been fixed in 4.1.1 patch. would your case be different from the one described in bug 13656397, I will be happy to get more details so that I can take a look at what is going on.
    Regards,
    Patrick

  • ODI updates all rows even when no change exists

    We use database triggers to update the created_by, creation_date, last_updated_by, last_updated_date columns on the records. From looking at these columns I can tell that ODI is updating every target record with the save values that are already present.
    I have tried using Journaling, but that I can't get that working, and I there are cases where I am not going to have the luxury of adding journal columns and triggers to my source database.
    Is there a way to have the interface only update records where the values have actually changed?
    Thanks,
    Kt

    In the interface diagram window, you will need to mark the columns created_by, creation_date, last_updated_by, last_updated_date to be executed on "Target".
    In addition,
    For created_by, creation_date, mark them for "Insert" only.
    For last_updated_by, last_updated_date, mark them for "Update" only.
    Hope that helps

  • How to Update All Rows in ViewObjectImpl

    I have a SQL based VO with three attributes where two attributes are from SQL, and one is transient.
    The SQL returns,
    1, deptA
    2, deptB
    3, deptC
    4, deptD
    I need to populate the third attribute separately. Say I have a Java class that will give me,
    2, Dallas
    3, Chicago
    I want to be able to display in table form,
    1, deptA, null
    2, deptB, Dallas
    3, deptC, Chicago
    4, deptD, null
    I know I can do this in VORowImpl, where for each row, get my Java class, match the ID, and set the third attribute. But I am trying to avoid fetching all the cities again and again for each row. So instead, I tried fetching the cities only once in VOImpl, then in createRowFromResultSet, set the third attribute before returning. This works the way I want except for one problem. I noticed say if the SQL returns four rows, createRowFromResultSet is only called three times. The first row never passes through createRowFromResultSet. So I am able to set the third attribute correctly except for the first row.
    Any suggestions? Thanks.

    The extra information for the third attribute is not available in the database. It can only come from the Java class. So a SQL join was not possible.
    The view link approach worked for me. I created SQL based VO1 and Java based VO2 and linked them. Then added transient attributes on VO1 and used Groovy to pull the value from VO2.
    Thanks for all the input.

  • Failing to update all rows in a table

    Hello, I want to go through every row in a tbale and update values, but it does not work. The error message complains about too small buffer size, and when I add bigger buffett size, (as included in the example), the execution never stops...
    CREATE OR REPLACE PROCEDURE convert_frn AS
    counter NUMBER;
    BEGIN
    DBMS_OUTPUT.enable(10000);
    SELECT COUNT(fixedcoupondatenb)
    INTO counter
    FROM floating_rate_note;
    FOR i IN 1 .. counter
    LOOP
    UPDATE floating_rate_note
    SET fixedcoupondatenb = '1'
    WHERE fixedcoupondatenb = 'YES';
    UPDATE floating_rate_note
    SET fixedcoupondatenb = '0'
    WHERE fixedcoupondatenb = 'NO';
    END LOOP;
    COMMIT;
    END convert_frn;
    best regards
    Harald

    You don't need a loop.
    You are working with SQL which means you have to think in sets. With your two update statements executed once ALL records in the floating_rate_note table with fixedcoupondatenb = 'YES' or 'NO' are updated in one shot.
    So your procedure should be:
    CREATE OR REPLACE PROCEDURE convert_frn
    AS
    BEGIN
      UPDATE floating_rate_note
      SET fixedcoupondatenb = decode(fixedcoupondatenb,'NO','0','YES','1')
      WHERE fixedcoupondatenb in ('YES','NO')
    END convert_frn;Regards,
    Rob.

  • JComboBox doesn't show all Rows in the View Object

    Hi,
    I've got a JComboBox which shows only 25 rows of the VO and I'm sure there are at least 50 or more rows.
    I'm also sure this is not JComboBox.maximuRowCount's fault, which just in case i've set to Integer.MAX_VALUE.
    Why is this happening? How could i change it?
    Thanks in advance. Pablo.

    set the RangeSize attribute of the iterator that is populating the
    list values to minus one (–1). This will ensure that all of the possible list
    items will appear in the list. Failure to do this will restrict your lists to a
    maximum of 25 entries, the default value of the RangeSize property.

  • Read all rows in static table defined in the adobe form using webdynproABAP

    Hi all,
    The requirement is i have to display the 5 empty rows using adobe forms in the table format and retrieve the data from that 5 rows after user enter some value and post it in the database table. This is the part of my requirement.
    I have done the designing part in interactive form and coding in WD using ABAP.
    For that, I defined table in the adobe forms where in the DATA subform I have given Min count value is 5 instead of 1(selected the check box - repeat each item... also). I am able to display 5 empty rows successfully. After enter values in 3 rows and press SAVE button i am getting only first record but not all 3 records.
    I have written the code for SAVE records in WD using ABAP. I am using this method "get_static_attributes_table" for getting all records.
    Please help me resolving my issue.
    Thanks in advance.

    Hi,
    In the WDDOINIT method, create an internal table with 5 empty rows and bind it to the context using the method Bind_Table.
    Then try executing your program, this should work.
    If it doesnt , do let me know.
    Regards,
    Runal
    Edited by: Runal Singh on Jun 11, 2009 3:00 PM
    Edited by: Runal Singh on Jun 11, 2009 3:08 PM

  • Can i update all my title and subtitle placeholders at one time with new text for the project?

    This seems like a simple thing to do, but I can't copy/paste.

    Hi there
    Sorry, but that doesn't appear to be possible.
    If you are using the Template feature of Captivate, you could use Variables and insert them into the areas so that you could populate by updating the variable.
    Of course you are also able to use variables outside of a template. But by using a template you are also configuring the look and feel, whilch is why I suggested it.
    Cheers... Rick

  • Update 100 Row Data In One Time against a Code

    Dear Expert,
    How can I update a Master Data Row Table record using a particular code. Like I write a query Update Table Set U_UDF = 'Value' Where Code = 2
    U_UDF is the field of Master Data Row Table's field. There are 100 Row against code 2 & I want to update all row with same value but in one time only.
    How can I do that ?
    Plz help me.
    Regards

    Hi,
    Try this:
    SAPbobsCOM.GeneralService oGeneralService = null;
                                                    SAPbobsCOM.GeneralData oGeneralData = null;
                                                    SAPbobsCOM.GeneralDataParams oGeneralParams = null;
                                                    SAPbobsCOM.CompanyService sCmp = null;
                                                    SAPbobsCOM.GeneralData oChild = null;
                                                    SAPbobsCOM.GeneralDataCollection oChildren = null;
                                                    sCmp = SBO_Company.GetCompanyService();
                                                    oGeneralService = sCmp.GetGeneralService("UDO");
                                                    // Get UDO record 
                                                    oGeneralParams = ((SAPbobsCOM.GeneralDataParams)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));
                                                    oGeneralParams.SetProperty("Code", ContractCode);
                                                    oGeneralData = oGeneralService.GetByParams(oGeneralParams);
                                                   // Add lines on UDO Child Table 
                                                    oChildren = oGeneralData.Child("CONTRACTDETAIL");
                                                    // Update an existing line 
                                                    oChild = oChildren.Item(LineId - 1);
                                                    DateTime dt = DateTime.Now;
                                                    oChild.SetProperty("U_STATS", "Terminated");
                                                    oChild.SetProperty("U_Updated", dt);
                                                    oChild.SetProperty("U_Remarks", "Service Terminated");
    //Update the UDO Record
                                                    oGeneralService.Update(oGeneralData);
    I have given you the sample. Just change it accordingly.
    Hope it helps.
    Thanks & Regards
    Ankit Chauhan

  • How to get  all rows of an attribute data from a table?

    Hello.. I´m using Jdev 10.1.3.2
    I have a table with 5 columns and N rows.
    I need to create a backing bean method to count the value of all rows of a specifc column.
    I use
    JUCtrlValueBindingRef selectedRowData= (JUCtrlValueBindingRef)myTable().getSelectedRowData();
    to get an attribute from a selected row. but How can get from all rows?
    Thank you
    Vandré

    Hi Vandré
    I think this example of Steve Muench will help you.
    "Recalc Sum of Salary at the View Object Level
    This example illustrates a technique where a transient attribute of a view object is updated to reflect the total sum of some attribute of all the rows in the view object's default row set. The code to recalculate the sum of the salary is in the getSumOfSal() method in the EmpViewImpl.java class. The custom EmpViewRowImpl.java class for the view row implements the getter method for the SumOfSal attribute by delegating to this view object method. The EmpViewImpl class extends a base DeclarativeRecalculatingViewObjectImpl class that contains some generic code to enable declaratively indicating that one attribute's change should recalculate one or more other attributes. The EmpView defines the "Recalc_Sal" property to leverage this mechanism to recalculate the "SumOfSal" attribute. If you restrict the VO's results using the BC Tester tool, you'll see the sum of the salaries reflects the subset. If you add a new row or delete an existing row, the sum of sal is updated, too."
    http://otn.oracle.com/products/jdev/tips/muench/recalctotalvo/RecalcTotalOfRowsInVO.zip
    Good Luck

  • Option to insert into all rows

    How would I create an option that gives the user a choice of inserting a value into all rows or just a specific row in a table?

    Doris,
    I'm assuming you mean "update" rather than "insert", since "inserting a value into all rows" doesn't really make sense to me.
    Anyway, there's lots of ways you can present this to the users, but at the backend it will come down to your use of a where clause, e.g.
    "update employees set salary = 20000"
    will update all rows and set the salary column to 20000, whereas -
    "update employees set salary = 20000 where emp_id = 37"
    will only update the row for the employee with emp_id = 37.
    Hope this helps.

Maybe you are looking for

  • AD Replication issues, SYSVOL / NETLOGON not replicating

    Hello Experts! We have a client that recently called us for some assistance. The IT department had a new virtual environment stood up. They Created 3 new VMs and promoted them all to domain controllers. The current domain and forest functional levels

  • Copying/burning a dvd, won't play in a dvd player

    Before my disk drive was replaced I could take a dvd, copy it and burn it to a disc (i.e., make a copy for myself), ad it would pla in my dvd player Since then when I make a copy of something and burn it, it won;t play in ant DVD player. Will play on

  • Help!  Dreamweaver Opens Automatically with Browser

    Hi everyone, I'm using a trial of CS5.  I don't use Dreamweaver, but something during the trial popped up and asked something about my browser settings.  I thought I just closed the window, but now Dreamweaver opens EVERY TIME I open a new browser wi

  • Connecting DI API with wrong user name or password

    I have an addon connecting to DI API by user login. If user types wrong username or password, the Company.Connect() runs endlessly. However I try to stop this process, I have no chance to do so. I tried by starting the Company.Connect() in a separate

  • Dynamic Email with Complete PDF sent

    I have a Livecycle form with multiple email list and I need to send the complete PDF to the dynamic email can anyone help me please?