Assigning sequential numbers to multiple rows with a common attribute

Oracle 10i, looking to modify a query to only select a total of 96 unique compoundnames and number each group of batchids 1-96.
Input
Table EX
Unique_ID, CompoundName, BatchID, Quantity
1, EX 1000, EX 1000 100, 100
2, EX 1000, EX 1000 101, 100
3, EX 1000, EX 1000 102, 100
4, EX 1001, EX 1001 100, 100
5, EX 1001, EX 1001 101, 100
6, EX 1001, EX 1001 102, 100
7, EX 1001, EX 1001 103, 100
8, EX 1001, EX 1001 104, 100
9, EX 1001, EX 1001 105, 100
10, EX 1002, EX 1002 100, 100
11, EX 1002, EX 1002 101, 100
12, EX 1002, EX 1002 102, 100
100+, EX 1095, EX 1095 100, 100
Using
select distinct * from
Select Unique_id, CompoundName, batchid, quantity, SUM(QUANTITY) over (partition by CompoundName) sumqty
FROM EX
where sumqty < 500
Order by 2,3;
Gives the data batched together by compoundnames and the total quantity of all the data sharing the same compound name (and only results whose total quantity is < 500).
I'm looking for a way to only grab 96 unique compoundnames (not total rows of data) at a time and numbering them to look like this desired output;
Unique_ID, CompoundName, BatchID, Quantity, SUM(Quantity), ???
1, EX 1000, EX 1000 100, 100, 300, 1
2, EX 1000, EX 1000 101, 100, 300, 1
3, EX 1000, EX 1000 102, 100, 300, 1
10, EX 1002, EX 1002 100, 100, 300, 2
11, EX 1002, EX 1002 101, 100, 300, 2
12, EX 1002, EX 1002 102, 100, 300, 2
100+, EX 1095, EX 1095 100, 100, 100, 96
Thanks in advance.
Edited by: user13112928 on Jun 26, 2010 11:49 AM
Edited by: user13112928 on Jun 26, 2010 11:50 AM
Edited by: user13112928 on Jun 26, 2010 12:01 PM

Hi,
If you want the numbers to be assigned only to the groups that remain after the groups where sumqty >= 500 or more have been excluded, then you have to assign the numbers after the groups where sumqty >= 500 or more have been excluded. All analytic funtions in the same sub-query are computed at the same time, so if you want to use analytic functions only, you have to do something like this:
SELECT DISTINCT
FROM     (
          SELECT      s.*
          ,     DENSE_RANK () OVER (ORDER BY compoundname)     AS rnk
          FROM     (
                    SELECT     Unique_id
                    ,      CompoundName
                    ,      batchid
                    ,      quantity
                    ,      SUM (quantity) OVER (PARTITION BY CompoundName)     AS sumqty
                    FROM     ex
               )     s
          WHERE     sum_qty     < 500
WHERE       rnk     <= 96
ORDER BY  batchid
,       quantity
;Since analytic funtions are evaluated after the GROUP BY and HAVING clauses, you could also do it this way, with only one sub-query:
WITH     got_rnk          AS
     SELECT       CompoundName
     ,       SUM (quantity)               AS sumqty
     ,       ROW_NUMBER () OVER (ORDER BY  CompoundName)     AS rnk
     FROM       ex
     GROUP BY  CompoundName
     HAVING       SUM (quantity)     < 500
SELECT DISTINCT
       e.unique_id
,       e.CompoundName
,       e.batchid
,       e.quantity
,       r.sumqty
,       r.rnk
FROM       ex          e
,       got_r_num     r     ON     e.CompoundName     = r.CompoundName
WHERE       r.rnk     <= 96
ORDER BY  e.batchid
,       e.quantity
;I'm not sure the latter will be any faster, since it needs to make two passes through ex.

Similar Messages

  • Web dynpro screen with multiple rows with columns that can be edited

    Web dynpro screen with multiple rows with columns that can be edited individually:
    Hi
    I am busy creating a screen in web dynpro for ABAP which we would like to make available via Portal ESS (Portal 7).
    I need to add 'n type of table (or almost something like Excel) or something in which someone can type a few paycode numbers (there should be lets say 10 blank rows in which info can be typed in and if I click on a button or so, more rows must be added if necessary.  Then in the other colums stuff like amounts must be entered which one should also be able to edit then and there.
    Can anyone assist in what I can use for this?  There does not seem to be some existing element that I can use.
    Help will be appreciated.
    Regards
    Debbie

    Hi Debbie,
    Whiel Creating table you need to be care full that use chose INPUT FIELD as the CELL EDITOR. Just guessing that if ur table is not editable u might have choosen TextView as default cell editor type.
    check link for details on TABLE UI
    [http://help.sap.com/saphelp_erp2005/helpdata/EN/b5/ac884118aa1709e10000000a155106/frameset.htm]
    easy way is to first add UI ELEMENT TABLE to your VIEW, then right click over it & select create binding from context. After you have a pop up where you can select what columns you want what should be its cell editor etc.
    Greetings
    Prashant

  • Can we create JTable with multiple rows with varying number of columns ?

    Hi All,
    I came across a very typical problem related to JTable. My requirement is that cells should be added dynamically to the JTable. I create a JTable with initial size of 1,7 (row, columns) size. Once the 7 columns are filled with data, a new row should be created. But the requirement is, the new row i.e. second row should have only one cell in it initially. The number of cells should increase dynamically as the data is entered. The table is automatically taking the size of its previous row when new row is added. I tried by using setColumnCount() to change the number of columns to '1' for the second row but the same is getting applied to the first row also.
    So can you please help me out in this regard ? Is it possible to create a JTable of uneven size i.e. multiple rows with varying number of columns in each row ?
    Thanks in Advance.

    Well a JTable is always going to paint the same number of columns for each row. Anything is possible if you want to rewrite the JTable UI to do this, but I wouldn't recommend it. (I certainly don't know how to do it).
    A simpler solution might be to override the isCellEditable(...) method of JTable and prevent editing of column 2 until data in column 1 has been entered etc., etc. You may also want to provide a custom renderer that renderers the empty column differently, maybe with a grey color instead of a white color.

  • Select or deselect multiple rows with one single selection  event

    Does anyone know how to create a JTable which can select or deselect multiple rows with one single selection event in JTable. Fore example, if the table has
    row1
    row2
    row3
    row4
    row5
    row6
    What I need is when user select row1 or row2, both row1 and row2 should be set to be selected. Then if user press CTRL and click one of row3 or row4, both of them should be selected including the previouse selected row1 and row2.
    For deselection, if row1 and row2 are selected, when users deselect one of row1 or row2, both of them should be deselected.
    Hopefully someone can give me a hint.

    Here is a partial solution using a JList. Only one line gets highlighted when the user makes a selection in the list. But, two lines are returned. There is a blank line between every two lines.
         private void addLineToList() {
              String a = f_one.getText();
              String b = f_two.getText();
              if (a.length() == 0) {
                   Utils.showInformationMessage("Item field is empty.");
                   f_one.requestFocusInWindow();
                   return;
              if (b.length() == 0) {
                   Utils.showInformationMessage("Match field is empty.");
                   f_two.requestFocusInWindow();
                   return;
              model.addElement("item: " + a);
              model.addElement("match: " + b);
              model.addElement(" ");
              int size = model.getSize();
              pairList.setSelectedIndex(size - 3);
              f_one.setText("");
              f_two.setText("");
              f_one.requestFocusInWindow();
         private void editList() {
              if (pairList.getSelectedValue().toString().equalsIgnoreCase(" ")) {
                   Toolkit.getDefaultToolkit().beep();
                   f_one.requestFocusInWindow();
                   return;
              if (!f_one.getText().equals("")) {
                   int result = JOptionPane.showConfirmDialog(this,
                   "The Item field contains text. Replace the text?",
                   "Flash Card Activity", JOptionPane.YES_NO_OPTION,
                   OptionPane.INFORMATION_MESSAGE);
                   if (result == JOptionPane.NO_OPTION) return;
              if (!f_two.getText().equals("")) {
                   int result = JOptionPane.showConfirmDialog(this,
                   "The Match field contains text. Replace the text?",
                   "Flash Card Activity", JOptionPane.YES_NO_OPTION,
                   JOptionPane.INFORMATION_MESSAGE);
                   if (result == JOptionPane.NO_OPTION) return;
              String item = "";
              String match = "";
              int index = pairList.getSelectedIndex();
              String choice = model.getElementAt(index).toString();
              if (choice.startsWith("item")) {
                   item = choice;
                   match = model.getElementAt(index + 1).toString();
                   model.remove(index);
                   model.remove(index);
                   model.remove(index);
              else {
                   item = model.getElementAt(index - 1).toString();
                   match = choice;
                   model.remove(index + 1);
                   model.remove(index);
                   model.remove(index - 1);
              int size = model.getSize();
              if (size > 2) {
                   pairList.setSelectedIndex(size - 2);
              f_one.setText(item.substring(6));
              f_two.setText(match.substring(7));
              f_one.requestFocusInWindow();
         }

  • I want to read and assign value of ADF Table rows  with Java Script

    Hi,
    I want to read and assign value of ADF Table rows with Java Script, but I cant true index of current row , so I assign wrong value to anathor column of ADF Table.
    My Code;
    ADF Table items
    <af:column sortProperty="Adet" sortable="false"
    headerText="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.labels.Adet}"
    binding="#{backing_ucret.column2}" id="column2">
    <af:inputText value="#{row.Adet}"
    required="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.attrDefs.Adet.mandatory}"
    columns="10"
    binding="#{backing_ucret.inputText2}"
    id="inputText2" onchange="getTutar('#{bindings.voHarcamaOdeme1Iterator.rangeStart + bindings.voHarcamaOdeme1Iterator.currentRowIndexInRange + 1}','#{bindings.voHarcamaOdeme1Iterator.estimatedRowCount}','#{row.index}')">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.formats.Adet}"/>
    </af:inputText>
    </af:column>
    MY JAVA SCRIPT CODE
    <f:verbatim>
    <script language="javascript" type="text/javascript">
    function getTutar(rowkey,totalrow,currentRow){
    alert('rowkey--totalRow--currentRow-->'+rowkey+'--'+totalrow+'--'+currentRow);
    if (currentRow==0) {
    rowkey=totalrow-1;
    }else{
    var rw=totalrow-currentRow-1;
    rowkey=rw;
    alert(document.getElementById('form1:table1:'+rowkey+':inputText8').value);
    alert(document.getElementById('form1:table1:'+currentRow+':inputText8').value);
    var birim_ucret=document.getElementById('form1:table1:'+rowkey+':inputText8').value;
    var adet=document.getElementById('form1:table1:'+rowkey+':inputText2').value;
    document.getElementById('form1:table1:'+rowkey+':inputText3').value=birim_ucret*adet;
    document.getElementById('form1:inputText6').value=0;
    var t;
    var toplam=0;
    alert('before Sum');
    for (var i=0;i!=totalrow-1;i++){
    t = document.getElementById('form1:table1:'+i+':inputText3');
    toplam+=t.value*1;
    document.getElementById('form1:inputText6').value=toplam;
    </script>
    </f:verbatim>

    You can achieve the use case you describe with partial page rendering (PPR), a feature of the ADF Faces framework. Here are a few posts that achieve an interactive behavior using PPR. Off the top of my head I do not know of an exact example, but this should be a good starting point:
    http://thepeninsulasedge.com/blog/2006/09/12/adf-faces-aftableselectmany/
    http://thepeninsulasedge.com/blog/2006/08/31/adf-faces-working-with-aftableselectone-and-the-dialog-framework/
    --RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Assigning sequential numbers for every lines within a group of records

    The scenario is:
    This set of records with group number, lets say 100(group number) contains 7 lines/records. How to assign line numbers (sequential) for each line within these groups on the fly during the mapping process before inserting these set of rows in the target. I know it is easy to achieve in a procedure, but not sure how to do this in the mapping.
    please advice.
    Thanks,
    Prabha

    Use Rank function
    SQL> select empno,ename,deptno,(rank() over (partition by deptno order by empno)) seqno from emp;
    EMPNO ENAME DEPTNO SEQNO
    7782 CLARK 10 1
    7839 KING 10 2
    7934 MILLER 10 3
    7369 SMITH1 20 1
    7566 JONES 20 2
    7788 SCOTT 20 3
    7876 ADAMS 20 4
    7902 FORD 20 5
    7499 ALLEN 30 1
    7521 WARD 30 2
    7654 MARTIN 30 3
    7698 BLAKE 30 4
    7844 TURNER 30 5
    7900 JAMES 30 6
    1111 Test 40 1
    1222 test 1
    1333 2
    17 rows selected

  • Updating multiple rows with different values

    Hi!
    I have a problem. I need to update more then 1000 rows with different values. How can I do it?
    For exsample i have table:
    id; color, date,
    1 red
    2 green
    3 white
    I need to update date field.
    Update table
    set date='01.02.03'
    where id=1
    Update table
    set date='01.03.03'
    where id=2
    Maybe there is way how to update multiple rows at one query?
    Sorry for my bad english.
    Thanks!

    Hi,
    You can try this
    UPDATE TABLE SET DATE = CASE
                        WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR')
                        WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR')
                        ENDcheers
    VT

  • Insert multiple rows with autoincrement id

    I need to insert multiple rows to a table which has an autoincrement PK (unique), e.g:
    Entity:
    public Class Entity{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    Private Long id;
    Facade:
    @PersistenceContext(unitName = "xx-enterprise-ejbPU")
    protected EntityManager em;
    public void create(Entity entity) {
    em.persist(entity);
    Service Class:
    public Class Service implements ServiceLocal{
    @EJB
    private XxxFacadeLocal xxxFacade;
    public void saveEntity(Entity entity){
    xxxFacade.create(entity)
    ManageBean:
    public Class ManageBean
    @EJB
    private ServiceLocal service;
    public void doSave(ActionEvent event)
    service.saveEntity(entity1); //entity.id is set to null, suppose to be generated by DB auto_increment, i.e. insert 3 rows with 3 different ids
    service.saveEntity(entity2);
    service.saveEntity(entity3);
    The result is: Key duplication error on inserting entity2, but entity1 is inserted into DB with id auto increased correctly.
    If I insert only one row each time for test purpose, everything works as expected.
    But what I need is to insert multiple rows. How to do it?
    Thank you in advance.

    Like this (although the @Basic annotation is very much unnecessary). So if it isn't happening you must have made a mistake somewhere. Are you sure the ID column actually has auto_increment?
    Also if you are using Hibernate as the persistence provider and you put it on the classpath, check the packages of the annotations you are using; Hibernate and JPA share some with the same name unfortunately.

  • Inserting multiple rows with single insert statement ?

    Hi ,,
    Consider a PL/SQL procedure.
    I want to pass an array of values and insert in a table with a single statement.
    Moreover I want to call this procedure to insert multiple rows from OCI program.
    Can some body help ? :(
    Thanks
    Chandu

    Hi Vincent,
    Regular array insert which you have mentioned works in case of insert statement(This is to eliminate multiple calls to server)
    Will it work for passing array to Stored procedure, in this case procedure will be called only once with an array.
    It will be of great help if you give an example.
    Thanks
    Chandra

  • Single Update command to update multiple rows with multiple rows

    Hi Gurus!
    Can I update table A with a result set of table b (multiple rows returns) where a.c1 = b.c1
    regards,
    SH

    As Joel mentioned this update will update all rows in a table based on another one:
    update tableA set seq_no = (select seqno from tableB where tableA.ID = tableB.ID)
    Also, any rows that don't match the select criteria will get updated to null. This could be very bad depending on what you want to do.
    To update a subset of tableA with data from tableB:
    update tableA set seq_no = (select seqno from tableB where tableA.ID = tableB.ID)
    where exists (select 1 from tableB where tableA.ID = tableB.ID)

  • Updating Multiple Rows With A Sequence

    I'm trying to update multiple rows of data in one column based on if its date is greater than a certain date. Starting with the lowest date from those dates I'll give it a 2000 and every ascending date from that point will be another number in sequence (2001, 2002, 2003, etc.).
    Apologization Edit:
    11g XE
    Edited by: spysmily1 on Jun 4, 2012 5:50 PM
    Edited by: spysmily1 on Jun 4, 2012 5:51 PM

    I would use a counter and start at a specific number. Then I would try to keep updating with this number and incrementing each time. The part I can't quite grasp is how to use this number with the lowest record and apply this sequence to each date that ascends from there. What I was going to try to come up with is something like:
    DECLARE
    counter := 2000;
    BEGIN
    loop
    update table_name
    set column_name = counter
    where date > specified date;
    counter := counter + 1;
    end loop;
    This is my first thought but I couldn't see a way to just update the first one that is greater than the specified date and then keep cycling through the dates until the last date(most recent). I know I would need a loop but what can I set that loop to so it would know when to stop. I could use a variable I know is less than the total amount that need to be altered.
    Edited by: spysmily1 on Jun 4, 2012 6:21 PM

  • Table maint genertr inserting multiple rows with all fields editable

    Hi
    I have created a ztable in se11 and maintained table maintenance generator SM30.
    Now i need to insert multiple rows into the table with all fields editable.
    How can i achieve this?
    Thanks in advance.

    >
    deepak thimmegowda wrote:
    > Hi
    >
    > I have created a ztable in se11 and maintained table maintenance generator SM30.
    >
    > Now i need to insert multiple rows into the table with all fields editable.
    >
    > How can i achieve this?
    >
    > Thanks in advance.
    Create a Table maintenance generator with One Step .
    regards,
    Jinson.

  • Multiple rows with single date

    I am using a CDC control task to extract and load data from our OLTP source to our Data Warehouse.
    For our Date dimension, we have a DateKey which is a
    DATETIME stamp (created using SSAS dimension wizard). Time is always 00:00:00 as a DATETIME
    value is required for populating the dates.
    Our fact table destination uses this DateKey as a FK.
    Our fact table OLTP data source contains multiple records with a single DATE and TIME field. This fine as I can convert the DATE field to a DATETIME using a derived column.
    However, as our Date dimension has granularity of a day, all we require for our fact table is the most recent daily record from our OLTP data source.
    At present, the data flow task is attempting to write all records and failing on PK constraint.
    How would I go about traversing all records for each date and loading only the most recent for that day? Is there a better way to go about this?

    If you wish to get only one record for today, you can simply use in your source query:
    SELECT TOP 1 ... FROM OLTPdata ORDER BY DEATETIMEcolumn DESC
    if you need one record for each date, you may use ranking functions:
    WITH Q AS (
    SELECT
    ROW_NUMBER() OVER (PARTITION BY CAST(DateTimeColumn AS DATE) ORDER BY DateTimeColumn DESC, some tie breaker column) AS ROWNUM,
    FROM  OLTPData
    SELECT * FROM Q WHERE ROWNUM=1

  • Retreiving multiple rows with stored procedures

    Hi,
    I'm having a little problem over here. I need to retreive some data (from an oracle db) via stored procedures. But I don't know how I can retreive multiple rows because when I execute a stored procedure which gives more dan 1 row back, Jave throws an exception.
    If someone could show me an example (or url) from how it should be done, it will be very much appreciated :-)
    Thanks in advance.

    A collection of (mostly) fully working example programs is provided by Oracle.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html
    I think what you're looking for it the RefCursor example, under "JDBC Basic Samples"

  • Highlight multiple rows with coding

    Hi all,
    Can anybody solved my problem?
    I have 3 JTable which are dependent of each other.
    Hence if i select a row in one of them, the other 2 need to highlighted
    respectively.
    I understand that using
    JTable.setRowSelectionInterval(int index0, int index1)
    can highlight rows by code, but it needs to be in a running order.
    I need to accomodate selection of multiple rows, some not in a running order.
    Anyway, thanks for your help in advance...

    Hi,
    Try compiling what I wrote below and running it. I'm pretty sure this is what you are trying to do?! Let me know if this is what you want.
    Thanks,
    code below
    package mypackage;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.util.EventObject;
    public class Dialog1 extends JDialog {
    JPanel _mainPanel;
    JTable _table1;
    JTable _table2;
    JTable _table3;
    MyListSelectionListener _table1Lstnr;
    MyListSelectionListener _table2Lstnr;
    MyListSelectionListener _table3Lstnr;
    Object[] _tablecol = {"Column1", "Column2", "Column3"};
    Object[][] _tablerow = { {"row1", "row1", "row1"},
    {"row2", "row2", "row2"},
    {"row3", "row3", "row3"},
    {"row4", "row4", "row4"},
    {"row5", "row5", "row5"},
    {"row6", "row6", "row6"}};
    Dimension TABLE_DIM = new Dimension( 50, 100 );
    public Dialog1() {
    this.setTitle("Test Frame");
    this.setModal(true);
    init();
    public void init() {
    _mainPanel = new JPanel( new GridBagLayout() );
    GridBagConstraints gbConstraints = new GridBagConstraints( 0,0,1,1,1,0,
    GridBagConstraints.NORTHWEST,GridBagConstraints.HORIZONTAL,
    new Insets(5,5,5,5),0,0);
    table1 = new JTable(tablerow, _tablecol);
    _table1.setName("table1");
    _table1.setColumnSelectionAllowed(false);
    _table1.setRowSelectionAllowed(true);
    table1.setSelectionMode(ListSelectionModel.MULTIPLEINTERVAL_SELECTION);
    table1Lstnr = new MyListSelectionListener(table1);
    table1.getSelectionModel().addListSelectionListener( table1Lstnr );
    JScrollPane table1SP = new JScrollPane( _table1 );
    table1SP.setPreferredSize( TABLE_DIM );
    _mainPanel.add( table1SP, gbConstraints );
    gbConstraints.gridy = 1;
    table2 = new JTable(tablerow, _tablecol);
    _table2.setName("table2");
    _table2.setColumnSelectionAllowed(false);
    _table2.setRowSelectionAllowed(true);
    table2.setSelectionMode(ListSelectionModel.MULTIPLEINTERVAL_SELECTION);
    table2Lstnr = new MyListSelectionListener(table1);
    table2.getSelectionModel().addListSelectionListener( table2Lstnr );
    JScrollPane table2SP = new JScrollPane( _table2 );
    table2SP.setPreferredSize( TABLE_DIM );
    _mainPanel.add( table2SP, gbConstraints );
    gbConstraints.gridy = 2;
    gbConstraints.weighty = 1;
    table3 = new JTable(tablerow, _tablecol);
    _table3.setName("table3");
    _table3.setColumnSelectionAllowed(false);
    _table3.setRowSelectionAllowed(true);
    table3.setSelectionMode(ListSelectionModel.MULTIPLEINTERVAL_SELECTION);
    table3Lstnr = new MyListSelectionListener(table1);
    table3.getSelectionModel().addListSelectionListener( table3Lstnr );
    JScrollPane table3SP = new JScrollPane( _table3 );
    table3SP.setPreferredSize( TABLE_DIM );
    _mainPanel.add( table3SP, gbConstraints );
    this.getContentPane().add( _mainPanel );
    class MyListSelectionListener implements ListSelectionListener {
    JTable selectedTable;
    MyListSelectionListener(JTable table) {
    selectedTable = table;
    public void valueChanged(ListSelectionEvent e) {
    String tableName = selectedTable.getName();
    int[] selectedRows;
    if( tableName.equals(_table1.getName()) ) {
    selectedRows = _table1.getSelectedRows();
    table2.getSelectionModel().removeListSelectionListener( table2Lstnr );
    table3.getSelectionModel().removeListSelectionListener( table3Lstnr );
    _table2.clearSelection();
    _table3.clearSelection();
    for( int i=0;i<selectedRows.length;i++){
    _table2.addRowSelectionInterval(selectedRows,selectedRows[i]);
    _table3.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    table2Lstnr = new MyListSelectionListener(table2);
    table3Lstnr = new MyListSelectionListener(table3);
    table2.getSelectionModel().addListSelectionListener( table2Lstnr );
    table3.getSelectionModel().addListSelectionListener( table3Lstnr );
    } else if( tableName.equals( _table2.getName()) ) {
    selectedRows = _table2.getSelectedRows();
    table1.getSelectionModel().removeListSelectionListener( table1Lstnr );
    table3.getSelectionModel().removeListSelectionListener( table3Lstnr );
    _table1.clearSelection();
    _table3.clearSelection();
    for( int i=0;i<selectedRows.length;i++){
    _table1.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    _table3.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    table1Lstnr = new MyListSelectionListener(table1);
    table3Lstnr = new MyListSelectionListener(table3);
    table1.getSelectionModel().addListSelectionListener( table1Lstnr );
    table3.getSelectionModel().addListSelectionListener( table3Lstnr );
    } else if( tableName.equals( _table3.getName()) ) {
    selectedRows = _table3.getSelectedRows();
    table1.getSelectionModel().removeListSelectionListener( table1Lstnr );
    table2.getSelectionModel().removeListSelectionListener( table2Lstnr );
    _table1.clearSelection();
    _table2.clearSelection();
    for( int i=0;i<selectedRows.length;i++){
    _table1.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    _table2.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    table1Lstnr = new MyListSelectionListener(table1);
    table2Lstnr = new MyListSelectionListener(table2);
    table1.getSelectionModel().addListSelectionListener( table1Lstnr );
    table2.getSelectionModel().addListSelectionListener( table2Lstnr );
    public static void main(String[] args) {
    Dialog1 dialog = new Dialog1();
    dialog.setSize( new Dimension( 400, 400 ) );
    dialog.setVisible(true);

Maybe you are looking for

  • Lines in Video-Live! Cam Video IM Pro (VF0230)

    I have horizontal lines in my web cam image. It is the VF0230 and I am using it on a older AMD pc, XP and 1 GB ram. Any help would be appreciated.

  • Acrobat 7 Typewriter Tool missing

    I have Acrobat 7 and the typewriter tool disappeared recently. Anybody knows how to get it back

  • Rational Rose 4 and '98 users

    If you are using Rational with Forte would you please contact me. Thanks -jim Jim Rice mailto:[email protected] Forte Software, Inc. http://www.forte.com National Tech Services Work#: 301-721-1910 To unsubscribe, email '[email protected]' with 'unsub

  • Sharing music between 2 ipods

    I have a nano and a classic. Most of my music is on the classic and not on my computer's library. I would like to transfer a few songs from the classic to the nano and/or the library on my computer. Is there any way to drag and drop from the classic

  • Sql remote connection

    Hi, I have the sql server running on another pc. I have the host name, username, and password for it. How can I access it from another computer? What do I need to have installed on this computer? Also, if I were to access it from java, what JDBC driv