Problem of VORowImpl - compare two lists of LINE]

Hello world

I have a huge problem right now, I am trying to compare two list VO with the same values, it's because a he tied to an advancedtable the xml page where the user can change some values and the other is the table values, but DB, the reason is in fact a validation to compare the original values from the DB with the tabla list and update only lines that users made changes in their values, here is my code for the better explain what I'm doing:

{} public void saveChanges()
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl) getDBTransaction ();
Row [] rows1 = getAppVO1 () .getAllRowsInRange ();
Row [] rows2 = getDBVO1 () .getAllRowsInRange ();
for (int i = 0; i < rows1.length; i ++) {}
int j = i;

To compare collections
R1: collection of the app
R2: collection of comics
AppVORowImpl r1 = rows1 (AppVORowImpl);
DBVORowImpl r2 = (DBVORowImpl) rows2 [j]; <-here in the second iteration is displayed the following error message:
"oracle.apps.fnd.framework.OAException: java.lang.ArrayIndexOutOfBoundsException: 1.

string variables to check if changes in the column
String columnAPP = r1.getId (m:System.NET.SocketAddress.ToString ());
String columnBD = r2.getId (m:System.NET.SocketAddress.ToString ());

"If" that commits the changes
{if (! columnAPP.Equals (columnBD))}

SP string variable
StringBuilder procedureCall = new StringBuilder();
the call to SP
try {}
procedureCall.append ("... stored proc...");
OracleCallableStatement oraclecallablestatement = (OracleCallableStatement) oadbtransactionimpl.createCallableStatement (procedureCall.toString (),-1);
oraclecallablestatement. Execute();
getOADBTransaction () .commit ();

} catch (SQLException sqlexception) {}
System.Err.println ("SQL Exception:" + sqlexception.getMessage ());
getOADBTransaction () .rollback ();
throw OAException.wrapperException (sqlexception);
} catch (Exception e) {}
System.Err.println ("Exception:" + e.getMessage ());
getOADBTransaction () .rollback ();
throw OAException.wrapperException (e);
}
}

}
}

the first iteration works fine, but the second and the futher shows an exception error, what can I do to make this method work?
I'll be waiting for your answers, I really hope you can help me with this one

Kind regards
Mentor

Here's the code to dump for you. Code, you should write in AmImpl and the same controller class call.

Code AMImpl

 public void executeBothViewObjects() //Calls this method from Controller *ProcessRequest*
     {

        OAViewObject vo = (OAViewObject)getMainViewObjectVO1();
        OAViewObject dvo = (OAViewObject)getDBViewObjectVO1();
       if (vo != null && dvo != null)
         {
                     //1st VO
                       dvo.setWhereClauseParams(null);
                      //Set where clause if Any  dvo.setWhereClauseParam(0,xx);
                      dvo.executeQuery();   

                     //2nd VO
                     vo.setWhereClauseParams(null);
                      //Set where clause if Any  dvo.setWhereClauseParam(0,xx);
                     vo.executeQuery();  

   }
  }

 public void compareViewObject()   // Calling this method to compare Attribute of both View Object *Process Form Request*
  {
      OAViewObject vo = getMainViewObjectVO1();
      OAViewObject OrigVO = getDBViewObjectVO1();

      MainViewObjectVORowImpl rowi = null;
      DBViewObjectVORowImpl rowii = null;

      int fetchedRowCount = vo.getRowCount();
      int OriginalfetchedRowCount = OrigVO.getRowCount();   

     RowSetIterator originalSelectIter = OrigVO.createRowSetIterator("originalSelectIter");
     RowSetIterator selectIter = vo.createRowSetIterator("selectIter");

     if (fetchedRowCount > 0 && OriginalfetchedRowCount >0)
        {
          selectIter.setRangeStart(0);
          selectIter.setRangeSize(fetchedRowCount);
          originalSelectIter.setRangeStart(0);
          originalSelectIter.setRangeSize(OriginalfetchedRowCount);
          for (int i = 0; i < fetchedRowCount; i++)
          {

            rowi = (MainViewObjectVORowImpl)selectIter.getRowAtRangeIndex(i);
            rowii = (DBViewObjectVORowImpl)originalSelectIter.getRowAtRangeIndex(i);

           //Compare Attribute here

               if((!(rowi.getRoleStartDate().equals(rowii.getRoleStartDate())) 

                {
                        // Comparing Start date here of both View Object
                }

             else if(((rowi.getRoleEndDate().equals(rowii.getRoleEndDate()))
               {
                   // Comparing End date here of both View Object
                }
          }
       }

}

Thank you
-Anil
http://oracleanil.blogspot.com/

Tags: Oracle Applications

Similar Questions

  • compare two PDFs using acrobat to adobe via command line

    Does anyone know how to compare two PDFs using acrobat to adobe via command line. I want to do this via command line, because we want to compare hundreds of files each day through some automated tasks in windows.

    If the command line option is not available in acrobat format, then it is possible to use acrobat javascript API to perform this task?

    Any kind of help will be greatly.

    Command line: not possible.

    JavaScript: Possible, but very limited. Basically, the only thing you can do is simulate the clicking Compare Documents. The rest must be done manually.

    However, it * might * be possible to automate this process a bit more using a plugin. Ask for more at the Acrobat SDK forum for more information...

  • How to compare two lines in PL/SQL?

    Hi all

    How to compare two lines in PL/SQL? Is there a method I can use to compare their column by column instead?

    Any comments would be much appreciated.

    PhoenixBai wrote:
    By lines I mean, two rows of the same table!

    Ah, finally, we get a bit more useful information

    and I need to compare the column by column to see if there is a difference between these two rows.

    Like this, you mean?

    SQL> ed
    Wrote file afiedt.buf
    
      1  with data as (select 1 as id, 'A' as dta, 'B' as dta2 from dual union all
      2                select 2, 'A', 'B' from dual union all
      3                select 3, 'B', 'C' from dual)
      4  --
      5      ,chk as (select &id1 as id1, &id2 as id2 from dual)
      6  --
      7  select case when (
      8    select count(*)
      9    from (
     10      select dta, dta2
     11      from data, chk
     12      where id = id1
     13      minus
     14      select dta, dta2
     15      from data, chk
     16      where id = id2
     17      )
     18    ) = 0 then 'No Difference'
     19          else 'Difference'
     20          end as check_result
     21* from dual
    SQL> /
    Enter value for id1: 1
    Enter value for id2: 2
    old   5:     ,chk as (select &id1 as id1, &id2 as id2 from dual)
    new   5:     ,chk as (select 1 as id1, 2 as id2 from dual)
    
    CHECK_RESULT
    -------------
    No Difference
    
    SQL> /
    Enter value for id1: 1
    Enter value for id2: 3
    old   5:     ,chk as (select &id1 as id1, &id2 as id2 from dual)
    new   5:     ,chk as (select 1 as id1, 3 as id2 from dual)
    
    CHECK_RESULT
    -------------
    Difference
    
    SQL>
    

    My only concern is the result of this sql. East - reliable? It can really be used to differentiate the two lines? I mean, the result would be the same, as I do with Java?

    Not sure what you mean by "reliable"? SQL is not some kind of generator of random result (by derogation from the use of the DBMS_RANDOM package). If you ask him if 1 + 1 = 2, then it will always give you the right answer.

  • Problem comparing two variables to help assess variable

    Hello
    IAM using 10.1.3.3 designer ODI where in I have a case to compare two variables.
    IAM using evaluate variable for it as Var1 = #Var2
    My case is as below
    If
    Var1 = Var2
    flow goes to xxx
    on the other
    flow goes to yyy

    I was faced with number format exception when I stated as digital variables. I changed to alpha numeric and tried again. This time the exception has disappeared, but the comparison happens as expected. I have the variables satisfying the real condition (var1 = var2 = 1234). But still the flow occurs for the condition false, which indicates that the comparison goes as planned. My DB is oracle.
    Any suggestions on this are appreciated.
    Thank you
    Naveen.

    Published by: 798664 on November 9, 2010 02:24

    Project you drag and drop your var1 and var2 in refreshing fashion
    Now do drag var1 in evaluation mode and make the comparison

    It must also include the code in your project.

    That is to say var1 = #. Var2
    then implement your business logic

    Thank you
    Fati

  • How to compare two files in Windows 7 prof 64 bit

    I have two files which has several files. I would like to compare the two files and see which folder has more files, and what are their names? How I do that in Windows 7 prof 64 bit? Is useful that I can download?

    Hey dude-

    Here's the right way to do without external downloads.  It looks like a lot at first, but once you have done so, it is very easy.  It works in all versions of Windows 7 to 95.  For our example, let's assume you're to compare two directories named 'A' and 'B '.

    1. run cmd.exe to get a command prompt.  (In Windows 7, the powershell will not work for this, FYI.)  Then do it again, so that you have two of them opened next to each other.

    2. in each window go into the directories you want to compare.  (With the help of the 'cd' command.  If you're not comfortable with that, then you should probably go with the external utilities, except if you want to learn the tricks of the command prompt.)

    3. type ' dir/b > A.txt' in one window and "dir/b > B.txt' in the other."  Now you have two text files that list the contents of each directory.  The flag/b means stripped, which removes the list down to only the names of files directories.

    4. move is the same folder as A.txt B.txt.

    5. Type "CF A.txt B.txt".  The command "CF" means file to compare.  It will spit out a list of the differences between the two files, with an additional line of text above and below each difference, so that you know where they are.  For more options on the way in which the output is in the format, type ' fc /? "at the command prompt.  You can also pipe the differences in another file using something like ' CF A.txt B.txt > differences.txt'.

    Have fun.

  • Compare two date columns

    Hello

    I want to compare two columns of dates in a table.

    Here, I wish to confirm that the two values are the same in each record.


    Hope that make sense



    See you soon

    Sexy

    Hi, Vanessa,.

    If d1 and d2 are the two DATE columns:

    SELECT     *     -- or list whatever columns you want to see
    FROM     table_x
    WHERE     d1 != d2
    ;
    

    Displays all the lines where they are declared, but not the same thing.

    If you want to include the lines where one of them is null, but the other is not:

    SELECT     *     -- or list whatever columsn\ you want to see
    FROM     table_x
    WHERE     LNNVL (d1 = d2)
    ;
    
  • Comparing two digital channels or waveform

    Hello

    How to compare two digital channels or the y-axis of the same lengths waveform channels and find the line that has about the same value in the channels. For example, suppose we have two digital channels X and Y which has about the same value in line 15. I need to write a script to find out in which line the canals coincide.

    Kind regards

    X.Ignatius

    Hi X.Ignatius,

    I subtract channels and use the CHNFIND function to search for string values that are zero or nearly zero.

    Greetings

    Walter

  • compare two jpeg taken by ip camera

    Hi people,

    I have an IP camera and I need to take two pictures and compare them, and then my program must return if there is something different about the image. Taking pictures is not a problem, using an activex with the library of camera control I can use a function that writes a JPEG disc. The real problem is to compare these images. I tried to hide them, but given that the sensor is a CMOS, there is a lot of noise, and even if I take two pictures without moving anything, when I subtracted the pictures it's not not empty (black). Then I tried to use Vision Assistent or the gold model, but I could not use them because of two problems:

    -first of all, most of the functions on Vision Assistent can only deal with 8-bit binary images. Does anyone knows how to convert a JPEG in this format?

    -Second, when I tried to open images to use the functions of the IMAQ on my own vi, I used the image.ctl IMAQ and typed the path to images and linked to service them, but whenever I run thid kind of VI, it returns an error indicating that the file is not an image.

    If you know how to solve one of these questions, or if you think of another method to compare the jpeg, please let me know!

    Kind regards

    Vitor

    Hello. Here is the solution. Simply define a level of similarity (for example 1%) and use this VI. Take care.

  • How to compare two source codes?

    Hello

    I would like to know if there is a way to compare the codes from different sources (different .vi or different groups of the vi...) in LabView?

    Our 2 production lines are similar, and I would like to know if there are differences in the 2... 2 production lines management programs because we have to make some changes.

    Thanks for your help

    Benedict

    ... Adding to the message of Putnam...

    We compare two available "Screw" and "VI predetermined.

    It will highlight the differences.

    Ben

  • In Adobe Acrobat 10.0.0 comparing two pdf files, it automatically locks. Can you please share how to avoid this type of comparison file accidents?

    Hi all

    In Adobe Acrobat 10.0.0 comparing two pdf files, it automatically locks. Can you please share how to avoid this type of comparison file accidents? If anyone with the idea, please share it.

    Hi sathishk15640596,

    Follow this thread to reset the Acrobat preferences:- How to reset preference settings in format Acrobat.

    If you are on Windows OS, open Acrobat, go to the Help menu and repair the installation.

    I would like to know is what happening to the entire document or certain act.

    Please check with another account user as well as to reproduce the problem.

    Kind regards

    Christian

  • The column that does not match when comparing two records

    Hi all

    We try to compare two tables and find the differences. So if two records (1 of each table) have same PK but not always matching because of some columns, then we would display this columnname. For example:

    Table 1

    PK Parent Child Property1 Property2
    1AA1P1PR1
    2BB1P2oraPR2
    3CC1P3SRP

    Table 2

    PK Parent Child Property1 Property2
    1AA1P1PR1
    2BB1P2PR2
    3CC1P3PR4

    In the above example when I compare 2 tables all matches except Property2 online n ° 3. Thus, we would like to get an output like:

    PK Column_Mismatch
    3Property2 (this must be the name of the column that does not match)

    Appreciate the help.

    Thank you

    Andy

    Hi, Andy.

    Andy1484 wrote:

    Hi all

    We try to compare two tables and find the differences. So if two records (1 of each table) have same PK but not always matching because of some columns, then we would display this columnname. For example:

    Table 1

    PK Parent Child Property1 Property2
    1 A A1 P1 PR1
    2 B B1 P2 oraPR2
    3 C C1 P3 PR3

    Table 2

    PK Parent Child Property1 Property2
    1 A A1 P1 PR1
    2 B B1 P2 PR2
    3 C C1 P3 PR4

    In the above example when I compare 2 tables all matches except Property2 online n ° 3. Thus, we would like to get an output like:

    PK Column_Mismatch
    3 Property2 (this must be the name of the column that does not match)

    Appreciate the help.

    Thank you

    Andy

    Why you don't want no matter what exit for pk = 2?  Property2 does not correspond either to pk.

    What happens if the 2 columns (or more) do not match?  The following query would produce a list delimited, such as ' parents; PROPERTY2 '.

    WITH got_mismatch AS

    (

    SELECT pk

    , CASE WHEN t1.parent <> t2.parent THEN '; PARENT' END

    || CASE WHEN t1.child <> t2.child THEN '; CHILD ' END

    || CASE WHEN t1.properry1 <> t2.property1 THEN '; PROPERTY1 ' END

    || CASE WHEN t1.properry2 <> t2.property2 THEN '; PROPERTY2 ' END

    AS the offset

    FROM table_1 t1

    JOIN table_2 t2 ON t2.pk = t1.pk

    )

    SELECT pk

    , SUBSTR (incompatibility, 3) AS column_mismatch

    OF got_mismatch

    WHERE mismatch IS NOT NULL

    ;

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

    The query above does not count NULL values as inadequate.  If you want that, the same basic approach will work, but you can use DECODE instead of <> to compare columns.

    What happens if a pk exist in a table, but not the other?  You want an outer join, where I used an inner join above.

  • How to compare 2 lists of box-multi-select/shuttle APEX (e.g.1:2:3 and 3:1:2) for equality?

    I want to validate 2 selections of list of shuttle for equality. for example

    1:2:5:7:18:3

    and

    1:5:7:2:3:18

    should be treated as equals and therefore valid (i.e. same selections but in different order)

    While

    1:2:5:7:18:3

    and

    1:2:18:9 are not equal and would fail validation.

    If I use the function string_to_table() on the two lists, then I need sort the associative arrays and then compare them for equality.  Any suggestions on the best way to do it?

    Thanks in advance

    PaulP

    Thanks for all help you, but I decided to stay with string_to_table APEX tables and keep things simple.  I decided to return Varchar2 ('TRUE', 'FALSE') instead of boolean (TRUE, FALSE) so I could use the function in a SQL WHERE clause.

    Here's my working solution

    create or replace FUNCTION CheckMultiSelectStringsEqual(
          p_string1    IN VARCHAR2 ,
          p_string2    IN VARCHAR2 ,
          p_separator IN VARCHAR2)
        RETURN varchar2
    ------------------------------------------------------------------------------------------------------------------
    -- This function accepts 2 multi-select/shuttle box strings in the format '1:2:3:5:12:4'
    -- and a string separator i.e.':' and irrespective of the order of individual selections within
    -- the string, returns 'TRUE' if the strings are equal else returns 'FALSE'.
    -----------------------------------------------------------------------------------------------------------------
      IS
        l_table1 apex_application_global.vc_arr2;
        l_table2 apex_application_global.vc_arr2;
        v_return varchar2(8);
      BEGIN
        if p_string1 is null or p_string2 is null or p_separator is null then
          raise_application_error(-20001,'USAGE: CheckMultiSelectStrings() function requires 2 not null strings and a separator character' );
        end if;
        l_table1 := apex_util.string_to_table(p_string1, p_separator);
        l_table2 := apex_util.string_to_table(p_string2, p_separator);
        if l_table1.count() <> l_table2.count() then
            return 'FALSE';
        end if;
        <>
        FOR i IN 1..l_table1.count() LOOP
            FOR j IN 1..l_table2.count() LOOP
               if l_table1(i)=l_table2(j) then
                 v_return:='TRUE';
                 continue OUTER_LOOP;
               else
                 v_return:= 'FALSE';
                 continue;
               end if;
            END LOOP; -- FOR j IN 1..l_table2...
            EXIT OUTER_LOOP WHEN v_return = 'FALSE';
        END LOOP; --FOR i IN 1..l_table1.
        RETURN v_return;
      END;
    

    -= == HERE IS THE TEST FOR THE FUNCTION CODE =.

    set serveroutput on
    declare
    v_return varchar2(8);
    begin
    v_return:= CheckMultiSelectStringsEqual('1:2:3:4','2:1:3:4',':');
          if v_return='TRUE' then
              dbms_output.put_line('Strings are equal');
          else
              dbms_output.put_line('Strings are NOT equal');
          end if;
    end;
    

    Hope this helps someone...

    PaulP

  • Compare two value table

    I want to compare two table value is the same, the result I want is can alert 1,5,6, but the result is now only 6

    var myText1 = "1,3,5,6."

    var myText2 = "+ 1, + 2, 3, + 4, + 5";

    var array1 = myText1.split(",");

    var array2 = myText2.split(",");

    for (var i = 0; i < array1.length; i ++) {}

    ~ alert (array2.toString (.valueOf (array1 [i])));

    If (array2. ToString(). IndexOf (array1 [i]) ==-1) {}

    Alert ("havn't" + array1 [i]);

    }

    }

    Hello

    Delete "var" on line 14

    1,5,6 on my side...

    Jarek

  • Compare two rows in the same table

    Hi all

    I need to compare two rows in the same table, I don't know hoe to do it in pl/sql. Please help me on this.

    example:

    price of ro TR
    xya0001 AMA.7 12
    xya0003 ama6 14
    xya0004 AMA.7 16

    in table b is a unique value for each line, I need to compare the price column and see if the first value is less than or greater than the following value and, if there is more to put the corresponding value of br to a variable, and if it is less, put the corresponding value of the br to another variable. I don't know a method to do this, as I'm new to pl/sql. Please help me in this
    for data in(select tr,br,price, lag(price) over ( order by tr) newcol
    from yourtable)
    loop
    if nvl(data.newcol,0) > data.price then
    variable1:=data.br;
    else
    varable2:=data.br;
    end if;
    end loop;
    
  • BUG? Statement of BRIDGE to compare two tables

    Hello

    I tried to compare two tables different dbs and remembered a post on applications to Connectin Cross
    http://barrymcgillin.blogspot.com/2010/11/cross-connection-queries.html
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)
    (SELECT * FROM temparb 
    MINUS 
    SELECT * FROM arb
    )
    UNION ALL
    (SELECT * FROM arb
    MINUS
    SELECT * FROM temparb 
    );
    I expect to get the differences between the ARB table in my current schema and the table alias temparb arb in the other db. Yet it seems that in this case only the table in my current schema is read.

    I materialize at the table BRIDGE with
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)
    and select the value that I know to be only in the remote schema
    SELECT id FROM temparb WHERE id = 2562;
    SELECT id FROM arb WHERE id = 2562;
    Both times I get no results. I even tried to use aliases on the table, same result. Tested in EA3 3.0 and 3.1.

    Has anyone tried this before?

    Concerning
    Marcus

    Hi Marcus,

    Have you tried without the quotes around the name of connection?

    I have a named connection
    system_local
    which I run the following command

    drop table testbridge_remote;
    drop table testdbrige;
    create table testbridge (col1 int);
    insert into testbridge values (1);
    insert into testbridge values (2);
    insert into testbridge values (3);
    commit;

    I have a named connection
    Name of the connection with space
    I performed the following in the

    drop table testdbrige;
    create table testbridge (col1 int);
    insert into testbridge values (4);
    insert into testbridge values (5);
    insert into testbridge values (3);
    commit;

    Then I can execute the following statement in the connection of system_local/worksheet

    BRIDGE testbridge_remote as the name of connection with Space(select * from testbridge)
    + (SELECT * FROM testbridge_remote +)
    LESS
    SELECT * from testbridge
    +)+
    UNION ALL
    + (SELECT * FROM testbridge +)
    LESS
    SELECT * from testbridge_remote
    +);+

    It works well.
    Returns the rows in the remote table not in the local table and lines in the local table, not the remote table.

    Kind regards
    Dermot
    SQL development team.

Maybe you are looking for

  • SAFARI APP ON DESKTOP DEFINITELY need... HE DISAPPEARED

    SAFARI is no longer on my DESK. HOW CAN I RETURN IT TO THE OFFICE AT ALL TIMES?

  • Migrating from Iphoto Library with disc

    I want to spend my iphoto library, which is huge (so I stored it on a drive hard seagate).  I tried to do that and click on the option button that I click on the photos icon and then select my library on the drive hard seagate. The computer gives me

  • Libretto U100 - cannot get the microphone to work

    Hello I have a problem with the microphone on laptop and also when using my headset Philips SHM3100 Multimedia bought recently. I tried to use the Windows Sound Recorder software, but my voice is not recognized at all. I have a headset Bluetooth Conf

  • Qosmio G20 system with CD recovery

    Hello everyone I have a G20 in which the internal CD-ROM does not work. I have the recovery CD is possible to make the recovery of the system by connecting the hard drive to another computer and retrieve the system recovery? I did tried to extract th

  • problem with WIN XP

    Hello.. Please help me with my problem of pc... If I start my pc, he hangs up on the windows logo so I tried to go into safe mode but he hangs up yet... other included options start windows normally and start in safe mode with command prompt, however