How to add two lines when the second row is not visible, but also gets the first data line too?

Mr President

Jdev worm is 12.2.1

How to add two lines when the second row is not visible, but also gets the first data line too?

I want to add two lines like below picture, but want the second to remain invisible.

tworows.png

I asked this question but my way of asking was wrong, that's why for me once again.

Concerning

Try to follow these steps:

1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

3. in your bookmark create button to create only one line NOT 2 rows.

4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

5 - Open the generated class to EntityImpl and go to the doDML method and write this code

  protected void doDML(int operation, TransactionEvent e)
  {
    if(operation == DML_INSERT)
    {
      SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
      oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
      setJoinColumn(seqValue);
      insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
    }

    if(operation == DML_UPDATE)
    {
      updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
    }

    super.doDML(operation, e);
  }
  private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
  {
    PreparedStatement stat = null;
    try
    {
      String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
      stat = getDBTransaction().createPreparedStatement(sql, 1);
      stat.executeUpdate();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    finally
    {
      try
      {
        stat.close();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }
  }

  private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
  {
    PreparedStatement stat = null;
    try
    {
      String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
      stat = getDBTransaction().createPreparedStatement(sql, 1);
      stat.executeUpdate();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    finally
    {
      try
      {
        stat.close();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }
  }

Tags: Java

Similar Questions

  • How to add two controls on the same form datagrid? I get the error message...

    Hello

    I have to add two controls on the same page datagrid. When I try to drag an another DataGrid in the components window, it says "an element with that name already exists in the library."

    How can I add multiple controls on the same page datagrid?

    Kind regards.

    _data2 = new XML (event.target.data2);

    should be

    _data2 = new XML (event.target.data);

    (actually, it's better if it was

    _data2 = XML (event.target.data);

  • How to add two columns in the criteria (OBIEE 11 g)

    Hello

    I try to add two columns in a criterion of obiee

    * "Done - OLB processed invoices. "" Invoice amount - currency "__" made - OLB processed invoices "." " The amount of taxes AR - billing currency"

    but the problem is:-
    The first column have 500000000 and the second column contains some NULL values from the table. I think that this could be the problem when I try to add that it gives no output.
    just an empty box.

    Can someone tell me how we can add columns in this State.

    Thank you to each and every one.

    Try IFNULL (expr, value)
    for the other columns

    "Done - OLB processed invoices". " Charge the amount - currency "+ IFNULL (" made - OLB processed invoices "". ")" AR tax - currency billing", 0)

    Published by: Srini VIEREN on March 20, 2013 10:02

  • How to add a user when the Muse site is transferred without Business Catalyst?

    Hello

    I downloaded a Muse site for my client on its own ftp server. But how do I add him as an editor of "inbrowser", so that she can manage the site needed? Or is it only possible to add a user when I upload the site on the host Business Catalyst?

    Thank you!

    Hello

    Update June 2014 to Muse allows In-Browser editing for Muse sites hosted with third-party providers (not Adobe).

    See https://helpx.adobe.com/muse/using/whats-new.html#In-browser%20Editing%20enhancements for more details.

    Abhishek

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • How to add more application under the new tab shortcuts when we right click on the desktop.

    How to add more application under the new tab shortcuts when we right click on the desktop.

    Hello

    I suggest you to post your questions in the forums 'Development of the User Interface for Windows Desktop' for better assistance.

    Here is the link: http://social.msdn.microsoft.com/Forums/en-US/windowsuidevelopment/threads

  • How to add a line break in shortDesc?

    How to add a line break in shortDesc?

    Hey Danny,

    I think you can't... but I did two work around to achieve this goal:

    1. in IE7 (not Mozilla Firefox) If you type a space between the words will be automatically pass the new line like:


    shortDesc = "firstWord... spaces... Second word"/ >

    2. you can use popup like a ToolTip like:








    Sameh Nassar

  • How to add 2 points on the Noel e? I don't have a 2nd series of digits to the right of the keyboard.

    How to add 2 points on the letter e in the Noel case?  I don't have the 2nd series of digits to the right of the keyboard. Windows 8

    Wednesday, April 23, 2014 23:25:53 + 0000, RobertNortonWZ wrote:

    How to add 2 points on the letter e in the Noel case?  I don't have the 2nd series of digits to the right of the keyboard. Windows 8

    You mean you want the e character? These two points are called a
    umlaut. You do not add points; the e with points is another
    a simple e character. There are several ways to get this
    character, but a simple is to hold the ALT key and type 137.

    As a point of information if you are interested, the subject of a
    umlaut is to indicate that the second of the two successive vowels is
    pronounced separately. So the word 'book' is pronounced buk, but the
    Book name is pronounced BO - ock.

  • How can I select the first date (at least) and the corresponding date of two different tables source?

    I have 2 tables, INVOICE and INVOICE_REFNUM similar to below. I'm writing a query that withdrawing the first date (less) for a single record remaining the two tables. Each table records the receipt of invoices, but according to the source of the received invoice some may reside in INVOICE_REFNUM and others the INVOICE table. I also use DECODE on the topic of INVOICE_SOURCE, when the date less is taken from the INVOICE table that contains that field, so if the date is in the field INVOICE_REFNUM DECODE is not necessary. Example:

    INVOICE (table)

    INVOICE_GID INVOICE_SOURCE INSERT_DATE

    ABC. AVRT123 I HAVE 11/03/2012-15:49:32

    ABC. CNWY234 G 12/03/2012 14:07:30

    ABC. UPGF678 M 15/03/2012 20:21:54

    INVOICE_REFNUM (table)

    INVOICE_GID INVOICE_REFNUM_QUAL INVOICE_REFNUM_VALUE INSERT_DATE

    ABC. AVRT123 SOURCE ACS 11/03/2012 14:49:32

    ABC. CNWY234 SOURCE CSA 12/03/2012 13:07:30

    ABC. UPGF678 SOURCE ACS 15/03/2012 21:21:54

    My decode statement is: DECODE ("INVOICE_SOURCE, 'I', 'IDE', 'G', ' Auto-Pay", ', 'Manual')

    If I were to write a query on these two tables, the output will resemble the following:

    INVOICE_GID INVOICE_SOURCE INSERT_DATE

    ABC. AVRT123 ACS 11/03/2012 14:49:32

    ABC. CNWY234 ACS 12/03/2012 13:07:30

    ABC. UPGF678 Manual 15/03/2012 20:21:54

    I worked on it for 2 days, and I was able to pull a date by using the following SQL code, but cannot determine how to extract the corresponding source:

    SELECT THE LEAST (GLOGOWNER. INVOICE_REFNUM. INSERT_DATE, GLOGOWNER. THE INVOICE. INSERT_DATE) AS 'DATE OF THE INVOICE.

    GLOGOWNER. THE INVOICE. INVOICE_GID,

    DECODE (GLOGOWNER. THE INVOICE. INVOICE_SOURCE, 'I', 'IDE', 'G', 'Auto-Pay', ', 'Manual').

    GLOGOWNER. INVOICE_REFNUM. INVOICE_REFNUM_VALUE

    OF GLOGOWNER. INVOICE

    LEFT JOIN GLOGOWNER. INVOICE_REFNUM

    ON GLOGOWNER. THE INVOICE. INVOICE_GID = GLOGOWNER. INVOICE_REFNUM. INVOICE_GID

    WHERE GLOGOWNER. INVOICE_REFNUM. INVOICE_REFNUM_VALUE = "ACS."

    AND GLOGOWNER. INVOICE_REFNUM. INVOICE_REFNUM_QUAL_GID = 'SOURCE '.

    AND GLOGOWNER. THE INVOICE. INVOICE_TYPE = 'I '.

    ORDER OF GLOGOWNER. THE INVOICE. INVOICE_GID

    Any help is greatly appreciated!

    Best regards

    -Adam

    Hello

    Is that what you want?

    SELECT i.invoice_gid

    CASE

    WHEN ir.insert_date<= i.insert_date ="" then ="">

    WHEN i.invoice_souce = 'I' and THEN 'EDI '.

    WHEN i.invoice_souce = 'G' THEN 'debit '.

    WHEN i.invoice_souce = am' THEN 'manual '.

    END AS invoice_source

    , The LEAST (i.insert_date, ir.insert_date) AS insert_date

    I have the Bill OF

    JOIN invoice_refnum ON i.invoice_gid = ir.invoice_gid ir

    WHERE ir.invoice_refnum_value = 'ACS '.

    AND ir.invoice_refnum_qual_gid = 'SOURCE '.

    AND i.invoice_type = 'I '.

    ORDER BY i.invoice_gid

    ;

    There is no reason to do an outer join if you only want the lines with specific values anyway.

    What happens if the 2 tables have exactly the same invoice_date?  The query above takes the invoice_source of invoice_refnum in this case, but that can easily be changed.

    Or the other of the insert_dates can be NULL?

    I hope that answers your question.

    Otherwise, thank you post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also after the results you want from these data (otherwise what you have already posted).

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • 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.

  • How to plot two variables when neither are expressed in time?

    I know how to trace a variable against time, but how to plot two variables when neither one of them are time against each other. For example if I want to draw Let's force against remote what is the best approach to use?

    Thank you.

    Use an XY Chart. Use context-sensitive help to see the expected data type and refer to the examples. Consider what follows, don't forget to rename the scale labels and name:

  • How to add a shortcut in the taskbar next to the Start Menu?

    I would like to know how to add a shortcut in the taskbar next to the Start Menu (a place with a small shortcut icon).

    Does anyone have any suggestions?
    Thanks in advance for your suggestions

    Hello

    Have a look here: http://www.sevenforums.com/tutorials/397-taskbar-pin-unpin-program.html

    When you scroll down on this page, you will find a lot more "pin to taskbar" - tutorials.

    Take a look at this little program free of practical assistance, too: http://winaero.com/comment.php?comment.news.108 of the taskbar Pinner

    I hope this helps.

  • How to add an outline to the text?

    How to add an outline to the text?

    Add a line in the character of the text layer settings.

  • I can't have multiple files open at the same time! I need to compare the content from one to the other. How to display two files at the same time?

    I can't have multiple files open at the same time! I need to compare the content from one to the other. How to display two files at the same time?

    Hi sindres79946597,

    Open Acrobat Reader DC, navigate to the Edit-> Preferences-> General-> uncheck "Open Documents in the new tab in the same window.

    Now, reboot your system, when you open multiple PDFs that all will open in a new window so that you can easily compare.

    Kind regards
    Nicos

  • How to add more line by line?

    Hi all

    Please let me know how to add addition line by line as the title:

    DEPTNO num1, num2, num3 total num
    1100 20 30
    1200 20 10
    1300 40
    1400 30


    your suggestion would be greatly appreciated.

    Something like that?

     SELECT deptno,num1,num2,num3, num1+num2+num3 "Tot"
     FROM ....
    

Maybe you are looking for

  • Satellite Pro NB10 - A - 10 PU143E - how to install Win 7

    Hello We recently bought the netbook above, that came pre-installed with Windows 8.1 pro.I want to install Windows 7 on the computer. Initially when I looked in the bios was not the option for the CSM,So I updated the bios, and now I have the MSC opt

  • Need to reinstall windows, but does not have any CD - Satellite Pro L20

    Hi, I wanted to reinstall Windows XP home on my Satellite Pro L20, but do not have the software that my laptop came with (read the discs lost). I have a valid XP tone (like its stuck on the bottom of my laptop), but no disc so I tired using a copy of

  • Windows Update causes the Startup Repair

    Hello, recently I received a windows update and I installed and rebooted successfully, but during the restart he send me to the Startup Repair in which it is said that the only solution is to go back to an earlier era. That works, and then finally it

  • Windows Vista Service Pack 2 updates

    I want windows to automatically download updates. I have my pc set to automatically download updates every day at 01:00. However, when I turn on my pc at about 09:00, he lets know me there are updates, but it will not install automatically. I install

  • Windows 7 will not install

    Try to install Windows 7 on new HD with the gateway factory reinstall disks. Will of the whole process, but the final reboot, I get the "Windows Setup cannot configure windows to work with this material" or something like that. I searched on several