Updating a Table row in OAF

Hi All
I have one table with one editable column. Once the user enters the value, the corresponding row has to be updated only in front end withopout updating the database. Please provide help on this.
Thanks

Either create readonly viewobject and bind it with the table
or
Create a transient attribute in the VO and bind it with the table column.
Now the changes made to the VO will be displayed in the screen and it wont go to the database.
--Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Disable delete icon in attachment table row in OAF

    Hi,
    I want to disable the Delete Icon in the attachments table in OAF Standard page. If the value in Title of that attachment row is "Requisition" the Delete Icon of that row should be disabled.
    It the Title is anything else then the Delete Icon should be enabled. Please let me know how to achieve this.
    Basically, if the Title is "Requisition", users should not be able to delete that attachment.
    Thanks,
    Srikanth

    Hi,
    check the program name for the transaction and create a screen exit for the same.
    Also u can go for copying the code in customer namespace and then add ur own functionality to dactivate or remove the delete function.
    Pls reward points for the answer.
    Regards,
    Ameet

  • Problem updating a table-row (changes are commited after "prerender()")

    Hi,
    I hope someone can help me on this:
    Background-info:
    The page which gives me problems should (and is) displaying one record of a query at a time. Depending on the button which can be pressed, the page should just display the next entry ("Next->") or change one column of the current entry and jump to the next entry ("Wrong / Next->"). After the last entry, the query should be (and is) executed again and the page should display the first column, which fits the query-criterias.
    The problem:
    If the query just finds one record, the record is displayed on that page.
    By pressing the "Next->" button, the page displays the same record again (like it should). By pressing the "Wrong / Next->" button, the page displays the same record again, although - like described above - one column was changed by that action and the query (which should and is executed again)
    should not find that record anymore. By pressing the "Wrong / Next->" button again, the page is not displaying a record anymore (like I expected it from the first time pressing that button).
    Technical Info:
    I am using one DataProvider for the "select" and an other one for the "update".
    Both are working fine.
    The "select" is called in the method "prerender()" and the "update" is called in the action of the button "Wrong / Next->".
    I debuged the program and found out, that the column of the database entry is changing it�s value not after processing the action of the button (like it should), but AFTER processing the method "prerender()". I tried to force the action of the button to commit the changes (xyDataProvider.commitChanges();), but without success.
    Code:
    public String buttonWrong_action() {
        try
            // Execute the Update-Statement
            sessionBean1.getXyRowSet().setObject(1, "2");
            sessionBean1.getXyRowSet().setObject(2, cardId);
            sessionBean1.getXyRowSet().setObject(3, operatorId);
            xyDataProvider.refresh();
        catch(Exception e)
        // Jump to the next record (set cursor)
    public void prerender() {
        try
            // Execute the Select-Statement
            sessionBean1.getZRowSet().setObject(1, operatorId);
            sessionBean1.getZRowSet().setObject(4, resultId); // ResultId (1 = Right, 2 = Wrong)
            zDataProvider.refresh();
            zDataProvider.cursorFirst();
            cardId       = sessionBean1.getCardRowSet().getString("id");
        catch(Exception e)
    }

    I suggest you read and understand Joel's blogs -
    http://blogs.sun.com/jfbrown
    Creator's CachedRowSet is designed for SELECT statements (only) and updating the ResultSet you get from that SELECT statement.
    (http://blogs.sun.com/jfbrown/entry/using_rowsets_for_crud_or )
    dataprovider.refresh() does not re-execute the rowset's command. It just means to "clear the previous results".
    (http://blogs.sun.com/jfbrown/entry/cachedrowsetdataprovider_and_cachedrowset_info )
    So here's how cachedRowSet's are designed to work:
    Set you rowset's command to:
    SELECT resultid FROM cardresult
    WHERE cardid = ?
    AND operatorid = ?
    They your code would do something like this:
    dp.getCachedRowSet().setObject(1, ...) ;
    dp.getCachedRowSet().setObject(2, ...) ;
    dp.getCachedRowSet().release() ;  // clear last results.
    boolean gotOne = dp.cursorFirst() ; // will cause execution
    if ( gotOne ) {
        dp.setValue('resultid', '2') ;
        dp.commitChanges() ;
    } else {
        error("can't update") ;
    }You'll have to adjust that code - it's just a generic example.
    Don't forget to add try/catch for a RuntimeException!
    The alternative is to write your own JDBC.
    You can use either.
    Personally I'd just write a little helper class to assist me with using plain old JDBC for this.

  • Listening to change in a row of a table a and update a table in a diferent Database

    i want to update a table using values from a different database table. how to i do it in SQl 2012

    i want to update a table using values from a different database table. how to i do it in SQl 2012
    With Service Broker?
    Without Service Broker, you would do:
    UPDATE targettbl
    SET    col1 = b.col1,
           col2 = b.col2,
    FROM   targettbl a
    JOIN   srctbl b ON a.keycol1 = b.keycol1
                   AND a.keycol2 = b.keycol2
    It is important that a row in targettbl maps to at most at one row in srctbl, or else the result will not be predictable.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to update a single row of data table

    How we can update a single row of the data table by clicking the button in the same row.
    Thanks in Advance.

    Hi!
    What do You mean 'update'? Get fresh data from DB or change data and commit it in DB?
    If commit, try to read here:
    http://developers.sun.com/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    Thanks,
    Roman.

  • How to verify that the user has changed table row data before db update

    Hi all,
    Iam using Oracle ADF with EJBs.
    I have a single selection table that displays rows of data returned from a function of my data control.
    The columns of my table are editable so that the user can change the data. The user selects a row, changes the data in one or more columns of the row and saves the data by means of a submit button. The code in the submit button, identifies the row of the corresponding iterator that the user clicked on and updates the data in the database (using the 'mergeEntity' function of the EntityManager)
    Before saving the data, I want to put some logic to check whether the user has actually changed some data to avoid unnecessary updates in the database . But for this I need a technique to detect that the user has indeed changed some data in the table row.
    One technique I have been using so far was to isolate the iterator row of the table and then query the corresponding row in the database table and compare their values.
    Except from dummy, this technique is not efficient if the table contains many rows.
    Moreover, in my case I have observed that on successive updates on the same row , the query on the database returns the new values (user changed values) and not the actual values contained in the database table. This means that when the user updates an iterator row the cached data affect also the results of the SELECT statement from the actual database table!!! Isn't this strange ?
    Can somebody propose me a neat method to detect when the user has changed the the data of an iterator row ?

    Hey Alan,
    The below solution seems overly complicated to me and can not be implemented without a custom screen and/or the use of JavaScript. Also, if your main concern is that a user may accidentally loose all their data because they closed the browser window or the session times out before they hit the save button then this solution does not help you.
    There are a couple of simpler approaches you can take here:
    # If the use of JavaScript is permissible you can hook into the windows 'onUnload' event, and pop-up a message box which gives the user the opportunity to cancel closing the window and save their case if they haven't already.
    # Implement an autosave feature by hooking into one of events provided by web determinations. A simple (but rather naive) way of doing this would be to hook into the OnRenderScreenEvent and call save on the interview session every time the event fires. This guarantees that all the data the user has submitted will aways automatically be saved, thereby removing the need to make sure the user manually saves their data before closing the browser.
    Automatically making Web Determinations close a browser window has to be done using JavaScript. However, doing so means that a) it won't work for people who turn off JavaScript, which is commonly done for accessibility reasons b) you'll likely run afoul of the browser's security mechanism (they generally won't let you close a window that you didn't open and some really don't like you doing that at all).
    Thanks,
    Kristy

  • How do I update/insert into a target table, rows after date X

    Hi all
    I have a mapping from source table A to target table B. Identical table structure.
    Target table A updates rows and inserts rows daily. Every week I want to synchronize this with table B.
    I have CREATION_DATE and LAST_UPDATE_DATE on both tables. I want to pass in a parameter to this mapping of date X which tells the mapping:
    "if CREATION_DATE is past X then do an insert of this row in B, if LAST_UPDATE_DATE is past X then do an update of this row in B"
    Please can you help me work out how to map this correctly as I am new to OWB.
    Many thanks
    Adi

    Hi,
    You can achieve this by -
    1. Create a control table, say Control_Table, with structure
    Map Name, last_load_date. Populate this table with the mappings that synchronizes your Table B.
    2. Alter mapping, that loads Table B to use the above control table to get all the records from Table A, you have to join Table A and Control_Table with the condition -
    Control_Table.Map_Name = < mapping name>
    AND ( TableA.Creation_Date > Control_Table.last_load_date
    OR TableA.Last_Update_Date > Control_Table.last_load_date )
    3. Then use UPDATE/INSERT on the Table B based on the Keys. This should take care of INSERT ( if not present) / UPDATE (if the row already exists).
    4. Schedule the mapping to run on weekly basis.
    5. You have to maintain the Control_Table to keep changing the values for Last_Load_Date to pick the data since the last time Table B is synchronized.
    HTH
    Mahesh

  • Updating a table to add a count of duplicates to each row

    I wondered if it is possible to do the following using a single SQL statement?
    To simplify my example, I have a table such as:
    create table tempftm_dups (product_id number, product_name varchar2(10), duplicate_count number);
    insert into tempftm_dups (product_id, product_name)
    values (1, 'CD');
    insert into tempftm_dups (product_id, product_name)
    values (2, 'BOOK');
    insert into tempftm_dups (product_id, product_name)
    values (3, 'DVD');
    insert into tempftm_dups (product_id, product_name)
    values (4, 'BOOK');
    This gives the result as below:
    SQL> select * from tempftm_dups;
    PRODUCT_ID PRODUCT_NA DUPLICATE_COUNT
    1 CD
    2 BOOK
    3 DVD
    4 BOOK
    I would like to update the table so the the duplicate_count column shows the number of times the PRODUCT_NAME is duplicated within the table. (ie. rows 2 and 4 would show a DUPLICATE_COUNT = 2, whereas rows 1 and 3 would show DUPLICATE_COUNT = 1).

    Something like this should do the trick.
    update tempftm_dups      t
       set t.duplicate_count = (
            with w_counter as (
                    select td.product_name
                         , count(*)           cnt
                      from tempftm_dups       td
                     group by td.product_name
            select wc.cnt
              from tempftm_dups       td
                 , w_counter          wc
             where td.product_name  = wc.product_name
             and   td.product_id    = t.product_id
            )Hope this helps,
    Gregory
    Message was edited by:
    Canis Polaris
    removed extraneous join in final select

  • Updating multpile tables and multiple rows - JDBC adapter

    Hi,
    The scenario is like this. i receive an Idoc which has header information and various line items (multiple occurrance of a segment). the hearder details have to be sent to one table, TableA, and all line items has to go to another table, TableB, and for each line item, a new row has to be inserted in TableB.
    How can i acheive this using JDBC adapter? how should my data type look like? what are the settings i need to do in adapter config?
    Thanks and Regards,
    Rashmi

    Hi Rashmi,
    You can use the following link for the JDBC adapter call :
    http://help.sap.com/saphelp_nw04/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    You need to provide the JDBC Driver, Connection,User Name and the password.
    The data type structure you can take from the Bhavesh blog:
    JDBC Receiver Adapter -- Synchronous Select – Step by Step
    Since you just need to update the tables, take only the sender side of the blog, i.e. the request part and configure the scenario accordingly.
    Regards,
    Sanjeev.

  • Simple mysql table row update

    Hi all,
    I am new to flex. Literally days into this. I have followed an example from the flex 3 bible and created a Flex applciation calling an AMFPHP service. I got the hello world to appear and was pretty chuffed with that. (code used is below)
    I have been asked to use some php code that I used to successfully add a row to my database. Apparently this is easy but I'm not getting it.
    All I want to do in this instance is add one row of data to my table. I guess I would just insert my php code in as a statement somewhere right?
    The table is on a server
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:RemoteObject id="phpService"
        destination="amfphp"
        source="MyClass. HelloWorld"/>
        <mx:Button label="Say Hello" click="phpService.sayHello()"/>
        <mx:Label text="{phpService.sayHello.lastResult}"/>
    </mx:Application>
    Below: Is this the right bit of code that would update?
    var sql:String =
        "INSERT INTO mytable (Row1, Row2, Row3 , Row4, Row5, Row6, Row7, Row8, Row9 , Row10) " +
        "VALUES ('Data1', 'Data2',  'Data3', 'Data4', 'Data5', 'Data6', 'Data7', 'Data8', 'Data9', 'Data10')";
    insertStmt.text  = sql;
    I really am confused by all this.
    Thanks in advance for any help

    Hi,
    here is a bit of code that may help you, when using amfphp you would have the php class that updates the record, to call that class from flex you would declare it as a remote object. You then send that object with the data to the server where the sql updates the table. The code below is for inserting a record updating a record requires a slightly different sql statement but the principle is pretty much the same.
    If you are using flashbuilder you can use zendamf and the data wizard will create your actionscriptcode and your php services code.
    David
         Actionscript code to update a record through amfphp
    <mx:RemoteObject id="catalog" fault="onFault(event)" showBusyCursor="true" source="qiksales" destination="amfphp">
            <mx:method name="newCategory" result="isEntered(event)" />
    </mx:RemoteObject>
         private function AddCategory(e:MouseEvent): void
    catalog.newCategory(100,'specials');
         Php function
    function newCategory($group, $category) {
         $mysql = mysql_connect(localhost,"root","");
         mysql_select_db( "catalog" );
         $Query = "INSERT INTO categorys (groupID, name) VALUES ('$group', '$category')";
         $Result = mysql_query( $Query );
         return($Result);

  • Table row updated by rowid but not with rownum.

    May i know why a table is not getting update when a row specified by rownum
    and getting updated when row specified by rowid.
    SQL> update emp1 set name='ddd' where rownum = 2;
    SQL> /
    0 rows updated.
    SQL> update emp1 set name='ddd' where rowid='AAJD/dAAPAAASoEAAB';
    1 row updated.
    Thanks
    Mary

    Why would it? ROWNUM and ROWID are completely different.
    ROWID relates to the physical location of a row on disk.
    ROWNUM is a pseudocolumn incremented as rows are RETURNED to the client. Specifying "WHERE ROWNUM = 2" is useless because as each row is examined for suitability, its ROWNUM will be set to 1. This is not equal to 2, so the row is rejected. The next row is then examined, with its ROWNUM of 1, and rejected again. Etc...

  • Updating A Table in a for each row trigger

    I have a trigger,
    create or replace trigger ins_ibpm_temp_trig
    after update of ethic_dt on ethics_approval_info for each row
    My issue is that I need to update the ethics_approval_info for each record based on the ethics date that was updated. I am getting the error
    ORA-04091: table ORACLETEST.ETHICS_APPROVAL_INFO is mutating, trigger/function may not see it.
    So the issue here of course is that I am trying to update a table, that is already in the middle of updating. Is there any way to get around this?

    Try these links
    Link1
    Link2
    Regards,
    Abdetu..

  • Updating table rows in Application Module class

    How can I update table rows in Application Module class?
    I'm using JDev 10.1.3 ADF BC, not JSF!
    Thanks.

    There are plenty of examples of doing this in the new ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center. No need to use raw JDBC.
    http://www.oracle.com/technology/products/adf/learnadf.html
    See Chapters 5 and 6 for a start.

  • Updating a table with billion rows

    It was an interview question, what's the best way to update a table with 10 billion rows. Give me your suggestions. Thanks in advance.
    svk

    The best way to answer questions such as this is NOT with a absolute and specific answer.  Instead, discuss your strategy for approaching the problem.  The first step is to understand your exact requirement.  It is surprising how often people
    write update statements with an under-qualified where clause. NEVER update a row that does not need to be updated.  For example, a statement like:
    update mytable set cola = 'ABC' where id in (1, 45, 212);
    Assuming id is unique for the table and the specified values exist in the table, we know 3 rows will be updated.  Do all of those rows need to be updated?  Think about it.  If cola is already set to 'ABC' for any of those rows, we could ignore
    those rows and make the update more efficient.  To do that, you need to add "and cola <> 'ABC' " to the where clause.   That is just one example of understanding exactly what you need to do - and doing only that which needs to be done.
    Once you understand exactly what you need to do, you need to analyze the impact of the update and identify any potential issues.  Updating a lot of rows can take a lot of time and consume large amounts of log and disk space.  What else is using
    the table?  Can you afford to lock the table for the duration of the update?  Are there concurrency issues, regardless of whether you update in batches or in one single statement?  When using a batch approach, is there an issue if someone runs
    a query against the table (i.e., the result is different from that of the same query run after all updates have been completed)?  Are you changing something which is included in an index?  Are you changing part of the clustered index? 
    Ultimately, every question you are asked is (or should be) designed to test your problem-solving skills and your skillset. IMO, it is relatively easy to improve your skillset of any particular tool, language, or environment.  The other - not so much
    and that is why they are more valuable IMO.

  • How to update all the rows of table using stored procedures

    Hi,
    I want to update all the rows of a table of a specific column
    sp_a  male
    sp_b female
    sp_c  male
    sp_d female
    in above table 
    gender of all the columns has to be interchanged.

    Sir table is like this detail(name varchar(10),gender varchar(10))
    Where Details  are like this 
    Name  Gender
    sp_a 
    male
    sp_b
    female
    sp_c 
    male
    sp_d
    female
    I want to create a stored procedure which automtically updates gender from male to female and female to male
    for all the rows . i.e., all the rows are updated for column gender by just running a stored procedure.
    So after execution of stored proc the above table looks
    Name  Gender
    sp_a 
    female
    sp_b
    male
    sp_c 
    female
    sp_d
    male

Maybe you are looking for