How to "discard" a row from a view

It seems to me like a simple thing, but I can't find an answer:
I want to programmatically remove a row from an executed view's rowset, but I don't want the underlying entities removed?
[I don't want any pending updates to the entities affected either. It's basically a UI thing - the user does something and I want to make the current row vanish.  I don't need or want to re-execute or alter the database as a result of this particular removal.]
Anyone know of a vo.removeRowWithoutAffectingEntities method?
Thanks,
Mike.

Found an old thread myself.
How to remove a row from a rowset
Will have to give this "hack" a try, I guess. (Sung, has this API been introduced into an unreleased version yet?)
I had already tried overriding the updateable-entities' remove methods (which are called from row.remove()), but it seems that the view-row hangs around if the entities aren't actually removed. Found some "removeEntityReferences (i.e. set them to null)" method on a QueryCollection and was wondering if calling that followed by a row.remove() might do the trick, but the method's protected anyway. Might still see if I can call it somehow. Any comments on the viability of this, Sung? (Given that the previous work-around was "uncharted territory"....)
Anyway, I guess I'll give the original work-around a shot. (Or make application non-ideally commit and requery!)
Mike.

Similar Messages

  • How to delete certain rows from Table view

    Hi Experts,
    I need to display result on the basis of certain process type. So i have used code like below.
           lv_iterator =   me->typed_context->searchresult->collection_wrapper->get_iterator( ).
           lv_entity = lv_iterator->get_first( ).
           WHILE lv_entity IS BOUND.
             CLEAR:lv_object.
             lv_object = lv_entity->get_property_as_string( iv_attr_name = 'PROCESS_TYPE' ).
             IF lv_object <> 'XXX'.
               lr_entity ?= lv_entity.
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
             ENDIF.
             lv_entity = lv_iterator->get_next( ).
           ENDWHILE.
    But only some of the entities from the collection are getting removed. Still some wrong entities exists which i cant even able to delete it by using ,
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
    Am i missing anything here?
    Regards,
    Santhosh

    Hi Santhosh,
    Maybe that is happening because you're removing elements from an object (collection_wrapper) inside your loop.
    Can you try to create an collection wrapper copy by using GET_COPY method, and then use and loop the iterator on your copied object, and remove the unwanted entities on your main object?
    Kind regards,
    Garcia

  • How to Delete certain rows from table view collection

    Hi Experts,
    I need to display result on the basis of certain process type. So i have used code like below.
           lv_iterator =   me->typed_context->searchresult->collection_wrapper->get_iterator( ).
           lv_entity = lv_iterator->get_first( ).
           WHILE lv_entity IS BOUND.
             CLEAR:lv_object.
             lv_object = lv_entity->get_property_as_string( iv_attr_name = 'PROCESS_TYPE' ).
             IF lv_object <> 'XXX'.
               lr_entity ?= lv_entity.
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
             ENDIF.
             lv_entity = lv_iterator->get_next( ).
           ENDWHILE.
    But only some of the entities from the collection are getting removed. Still some wrong entities exists which i cant even able to delete it by using ,
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
    Am i missing anything here?
    Regards,
    Santhosh

    Hi Santhosh,
    Maybe that is happening because you're removing elements from an object (collection_wrapper) inside your loop.
    Can you try to create an collection wrapper copy by using GET_COPY method, and then use and loop the iterator on your copied object, and remove the unwanted entities on your main object?
    Kind regards,
    Garcia

  • HOW TO GET THE SELECTED VALUE IN A ROW FROM ONE VIEW TO ANOTHER VIEW?

    hi all,
    I  have a small issue.
    i have created two views.In the table of the first view i'm selecting a row and pressing the button it will move to next view.
    i am adding some fields manually in the table of the second view and pressing the save button.Here all the values should get updated corresponding to the field which i have selected in the first view.
    I want to know how to get the particular field in the selected row from one view to another view.
    Kindly help me.

    Hi,
            Any data sharing accross views can be achiveved by defining CONTEXT data in COMPONENT CONTROLLER and mapping it to the CONTEXT of all the views. Follow the below steps.
    1. Define a CONTEXT NODE in component controller
    2. Define same CONTEXT NODE in all the views where this has to be accessed & changed.
    3. Go to CONTEXT NODE of each view, right click on the node and choose DEFINE MAPPING.
    This is how you map CONTEXT NODE and same can be accessed/changed from any VIEW or even from COMPONENT CONTROLLER. Any change happens at one VIEW will be automatically available in others.
    Check the below link for more info regarding same.
    [http://help.sap.com/saphelp_nw04s/helpdata/EN/48/444941db42f423e10000000a155106/content.htm]
    Regards,
    Manne.

  • How To Delete a row from view object

    Hi
    I have a table whose data is populated based on the view object... and for each row i have a delete icon...
    when i press on this delete icon i want to delete that particular row from the view object only..but not from the data
    base..please help me in this issue
    Thanks

    Hi,
    as per krishna priya says u can delete .
    -----1st one thing let me know vo is eo based .???.
    If not here is the sample code to delete a row not from the data base.:
    public void Deleterow(OAPageContext pageContext, OAWebBean webBean,String prjid)
    int idtodelete;
    int fetchedrowcount;
    Number prjojectid;
    RowSetIterator deleteIter;
    prjidtodelete=Integer.parseInt(prjid);
    OADBTransaction tr = getOADBTransaction();
    ProjectsVORowImpl row=null;
    ProjectsVOImpl vo= getProjectsVO1();
    fetchedrowcount=vo.getRowCount();
    deleteIter = vo.createRowSetIterator("deleteIter");
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedrowcount);
    for(int i=0;i<fetchedrowcount;i++)
    row= (ProjectsVORowImpl)deleteIter.getRowAtRangeIndex(i);
    prjojectid=(Number)row.getAttribute("ProjectId");
    if (prjojectid.compareTo(prjidtodelete)==0)
    row.remove();
    break;
    deleteIter.closeRowSetIterator();
    Regards
    Meher Irk
    Edited by: Meher Irk on Nov 2, 2010 12:42 AM

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to distinguish individual rows in a view?

    As well known, we can use rowid to distinguish individual rows in a table. However, who know how to distinguish individual rows in a view? For there are not rowid in a view.

    I'm not sure I usnderstand your question, or at least I hope I don't.
    We do not use ROWID to distinguish rows in a table: we use unique iodentifiers, that is primary keys. A primary key is stable across the lifetime of a record: a rowid is guaranteed only for the lifetime of a transaction, and then only if we have locked that row.
    From this it follows, we should so design our views that each row in the view has a column, or combination of columns, that uniquely identify it.
    Cheers, APC

  • When selecting a row from a view with a nested table I want just ONE entry returned

    Does a nested table in a view "EXPLODE" all values ALWAYS no matter the where clause for the nested table?
    I want to select ONE row from a view that has columns defined as TYPE which are PL/SQL TABLES OF other tables.
    when I specify a WHERE clause for my query it gives me the column "EXPLODED" with the values that mathc my WHERE clause at the end of the select.
    I dont want the "EXPLODED" nested table to show just the entry that matches my WHERE clause. Here is some more info:
    My select statement:
    SQL> select * from si_a31_per_vw v, TABLE(v.current_allergies) a where a.alg_seq
    =75;
    AAAHQPAAMAAAAfxAAA N00000 771 223774444 20 GREGG
    CADILLAC 12-MAY-69 M R3
    NON DENOMINATIONAL N STAFF USMC N
    U
    E06 11-JUN-02 H N
    05-JAN-00 Y Y
    USS SPAWAR
    353535 USS SPAWAR
    SI_ADDRESS_TYPE(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NUL
    L, NULL)
    SI_ADDRESS_TAB()
    SI_ALLERGY_TAB(SI_ALLERGY_TYPE(69, 'PENICILLIN', '11-JUN-02', NULL), SI_ALLERGY
    TYPE(74, 'SHELLFISH', '12-JUN-02', NULL), SIALLERGY_TYPE(68, 'PEANUTS', '13-J
    UN-02', NULL), SI_ALLERGY_TYPE(75, 'STRAWBERRIES', '13-JUN-02', NULL))
    SI_ALLERGY_TAB()
    75 STRAWBERRIES 13-JUN-02
    *******Notice the allergy entry of 75, Strawberries, 13-JUN-02 at the
    end. This is what I want not all the other exploded data.
    SQL> desc si_a31_per_vw
    Name Null? Type
    ........ Omitted uneeded previous column desc because of metalink
    character limit but the view is bigger then this.......
    DEPT_NAME VARCHAR2(20)
    DIV_NAME VARCHAR2(20)
    ADDRESSES SI_ADDRESS_TAB
    CURRENT_ALLERGIES SI_ALLERGY_TAB
    DELETED_ALLERGIES SI_ALLERGY_TAB
    SQL> desc si_allergy_tab
    si_allergy_tab TABLE OF SI_ALLERGY_TYPE
    Name Null? Type
    ALG_SEQ NUMBER
    ALG_NAME VARCHAR2(50)
    START_DATE DATE
    STOP_DATE DATE
    SQL> desc si_allergy_type
    Name Null? Type
    ALG_SEQ NUMBER
    ALG_NAME VARCHAR2(50)
    START_DATE DATE
    STOP_DATE DATE

    Can you explain what do you mean by the following?
    "PL/SQL tables (a.k.a. Index-by tables) cannot be used as the basis for columns and/or attributes"There are three kinds of collections:
    (NTB) Nested Tables
    (VAR) Varrying Arrays
    (IBT) Index-by Tables (the collection formerly known as "PL/SQL tables")
    NTB (and VAR) can be defined as persistent user defined data types, and can be used in table DDL (columns) and other user defined type specifications (attributes).
    SQL> CREATE TYPE my_ntb AS TABLE OF INTEGER;
    SQL> CREATE TABLE my_table ( id INTEGER PRIMARY KEY, ints my_ntb );
    SQL> CREATE TYPE my_object AS OBJECT ( id INTEGER, ints my_ntb );
    /IBT are declared inside stored procedures only and have slightly different syntax from NTB. Only variables in stored procedures can be based on IBT declarations.
    CREATE PROCEDURE my_proc IS
       TYPE my_ibt IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;  -- now you see why they are called Index-by Tables
       my_ibt_var my_ibt;
    BEGIN
       NULL;
    END;That sums up the significant differences as it relates to how they are declared and where they can be referenced.
    How are they the same?
    NTB and VAR can also be (non-persistently) declared in stored procedures like IBTs.
    Why would you then ever use IBTs?
    IBTs are significantly easier to work with, since you don't have to instantiate or extend them as you do with NTB and VAR, or
    Many other highly valuable PL/SQL programs make use of them, so you have to keep your code integrated/consistent.
    There's a lot more to be said, but I think this answers the question posed by Sri.
    Michael

  • How To Delete a Row From a TableView !!!!

    Hi,
    Does any know how to delete a row from a table view model.
    I have a TableViewModel being displayed, when the user select the particular row and click delete i want that particular row to be deleted.
    Any Suggestions How.
    Thanks,
    Emmanuel.

    If u want to delete single row, then set the property of TableView - selectionMode="SINGLESELECT". Select the radio button and click on delete button. In the main program, you can get the row value like...
    public void onDeleteButtonClicked(Event event) throws PageException {
    TableView table = (TableView) this.getComponentByName ("idTableView");
    DefaultTableViewModel dmodel = myBean.beanModel;
    String pid = "", row_selected;
    // Get the first visible row
    int firstVisibleRow = table.getVisibleFirstRow();
    // Get the last visible row
    int lastVisibleRow = table.getVisibleLastRow();
    for (int i = firstVisibleRow; i <= lastVisibleRow; i++) {
    if (table.isRowSelected(i)) {
      row_selected = i;
      pid = dmodel.getValueAt(i, 1).toString();
    "i" will give you the row no, pid has the value of the row at first column.
    Hope this helps.
    Thanks,
    Praveen

  • Passing Multiple table row from one view to another view

    Hi,
    How to Passing Multiple table row from one view to another view in Web Dynpro Abap. (Table UI Element)
    thanx....

    Hi Ganesh,
    Kindly do search before posting.. this discussed many times..
    First create your context in component controller, and do context mapping in two views so that you can get values from
    one veiw to any views.
    and for multiple selection, for table we have property selection mode.. set as multi and remember context node selection
    selection cardinality shoud be 0-n.
    so, select n no of rows and based on some action call sec view and display data.( i think you know navigation between veiw ).
    Pelase check this...for multi selection
    Re: How to copy data from one node to another or fromone table to another table
    for navigation.. check
    navigation between the views
    Cheers,
    Kris.

  • How to update duplicate row from table

    Hi,
    how to update duplicate row from table?
    First to find duplicate row then update duplicate row with no to that duplicate row in oracle.
    can you give me suggestion on it?
    Thanks in advance.
    your early response is appreciated...

    In order to find a duplicate row, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1224636375004
    (or search this forum, your question has been asked before)
    In order to update it, just create and use an Oracle sequence, have it start and increment at a value that doesn't exist in your table.
    If that doesn't get you going, post some CREATE TABLE + INSERT INTO statements, and the results you want from them, in other words: a complete testcase.

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • How i will retrive rows from object type

    test is object type(varchar2,varchar2)
    test1 is a object derived from test
    test1(varchar2,varchar2,test);
    how i will retrive rows from test1.
    declare
    type recf is ref cursor;
    v_tab test1 := test1('a','b',test('c','d'));
    rec recf;
    begin
    open rec for
    select * from table(cast(v_tab as test1));
    dbms_output.put_line('the rows are'||rec.test1.test11);
    end;
    when i compile this it return
    ERROR at line 7:
    ORA-06550: line 7, column 35:
    PL/SQL: ORA-22907: invalid CAST to a type that is not a nested table or VARRAY
    ORA-06550: line 7, column 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 8, column 48:
    PLS-00487: Invalid reference to variable 'REC'
    ORA-06550: line 8, column 1:
    PL/SQL: Statement ignored
    error.

    hi ur previous example really helping me but please help me in this current senario,
    PROCEDURE reserveNumbers (
         TheNumberRange IN NumberRange,
         UserID IN userid,
         ReturnStatus OUT CallStatus ); which is in P_Numbermgr_Api package.
    here NumberRange is a object
    TYPE NumberRange IS OBJECT (
         StartNumber               VARCHAR2(40),
         EndNumber               VARCHAR2(40),
         NumberAttributes          NumberAttr)
    NumberAttributes field based on NumberAttr object
    TYPE NumberAttr IS OBJECT (
         NumberType          VARCHAR2(15),
         CountryCode          VARCHAR2(10),
         CityCode      VARCHAR2(3))
    i write a package within package i am calling P_Numbermgr_Api.reserveNumbers:
    CREATE or replace TYPE My_numberrange IS TABLE OF numberrange;
    CREATE OR REPLACE PACKAGE numberrange_wrapper AS
    TYPE cursor_type IS REF CURSOR;
    TYPE cursor_type1 IS REF CURSOR;
    TYPE cursor_type2 IS REF CURSOR;
    v_userid number;
    PROCEDURE Getnumberrange (userid IN number,
    p_recordset OUT numberrange_wrapper.cursor_type);
    END numberrange_wrapper;
    within package body i write
    CREATE OR REPLACE PACKAGE body numberrange_wrapper AS
    PROCEDURE Getnumberrange (userid IN number,p_recordset IN OUT numberrange_wrapper.cursor_type)
    is
    v_tab My_numberrange := My_numberrange();
    refc numberrange_wrapper.cursor_type2;
    BEGIN
    numberrange_wrapper.v_userid:= userid;
    OPEN p_recordset FOR
    SELECT
         * FROM
         Table(Cast(v_tab As My_numberrange));
    P_Numbermgr_Api.reserveNumbers (My_numberrange,v_userid,p_recordset);
    END Getnumberrange;
    end numberrange_wrapper;
    it return
    PLS-00330: invalid use of type name or subtype name
    please help me how i will solve this problem

  • How to get first row from View Object cache.

    hi,
    I am using Jdeveloper 11.1.1.6
    can we get first row from View Object cache??
    Thanks in Advance.
    Best
    Shashidhar

    Hi Frank,
    Thanks for reply!!
    My case is:
    I have a Query based ViewObject.
    One of the field is LOV and remaining fields are in ADF table. the LOV field is out side ADF table when i insert first record in ADF table and i choose LOV  filed the value is selected.
    when i create second row LOV value got refreshed because both are in same VO.
    I need to get the LOV value of first row and set same value to second Row.
    Shashidhar

  • How to get first row from view iterator programatically?

    Hi All,
    I am using Jdeveloper 11g Release 2.
    I want to fetch the first row of a view iterator in a bean. Can any one guide me through this use case.
    Any help will be highly appreciated.
    Thanks ... Best Regards
    Bilal

    Use the code snippet as below:
    *// 1. Access the binding container*
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    *// 2. Find a named iterator binding*
    DCIteratorBinding iter = (DCIteratorBinding)bc.findIteratorBinding("<ITERATOR_NAME>");
    *//3. Get the RowSetIterator Object*
    RowSetIterator rsi = iter.getRowSetIterator();
    *//4. Get the First Row*
    Row firstRow = rsi.first();
    Thanks,
    Navaneeth

Maybe you are looking for

  • Trial Balance Closing

    Hi all expert, I have 5 company database and I already combine into one. Now the 5 of company I need to do a closing for TB, may I know how? Example:- TRADE DEBTORS - 1,000.00 TRADE DEBTORS INTERCO - 2,000.00 AR CLEARING - 3,000.00 TRADE CREDITOR - 5

  • How do I add a monitor dedicated to program monitor

    I have a large high def program monitor I used to use with Media 100.  Is there a way I can use that to monitor the Premiere Pro desktop program monitor full time (rather than going to full screen and back to "normal?"  Mac Pro. 10.8.5  Premiere Pro.

  • Windows XP and Boot Camp

    Hi I hope someone can help me because I think I am going to go mad. Basically I want to play Microsoft Flight Simulator 2004 on my 2011 Macbook Air via Boot Camp. I am a bit unsure on how to use boot camp, do I need to download the latest windows sup

  • After Effects 50 fps footage

    Hello, So I am SUPER new to anything After Effects but I am getting the hang of it, so if I don't know what your talking about just bare with me. Alright, so I shot some footage the other day on a Canon d3500 DSLR. I did not know that they shot on a

  • Vaio Duo 11 pen pressure unsupported?

    Hi, I've just bought Sony Vaio Duo 11 i7 edition with Windows 8 Pro, but I found pen pressure isn't working on neither Photoshop CS5.0.4 or Photoshop Elements 10, while its pen pressure works on Fresh Paint and Artrage 3.5.5. Can anyone help?