Selecting rows across multiple tables (SSCCE provided)

Greetings,
I have a program that has 3 tables. When the user selects a row on one table, I want the corresponding rows in the other tables to be selected also. A corresponding row is defined (in this case) as a row whose column 1 value is the same. Column 1, in this case, is a company name, and the tables reference yearly info for those companies. So, if a user selects company #34, I would like it to select company #34 across the other two tables, also.
I have established list selection listeners for each table that changes the selection for the other two tables.
This code, however, doesn't work. two things are broken: 1) the cross-selection only works if the selection is moving up the table, but not down the table. 2) the scrrollRectToVisible on the viewport isn't working. What am I doing wrong? Thanks in advance.
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
* @author Ryan
public class TableSelection {
    public static void main(String[] args){
        // Init data model data.
        Object[][] data = new Object[100][5];
        for(int i = 0; i < data.length; i++){
            data[0] = "Company # " + i;
for(int j = 1; j < data[i].length; j++){
data[i][j] = "" + i + ", " + j;
// Init headers.
String[] headers = {"Col 1" , "Col 2", "Col 3", "Col 4", "Col 5"};
// All 3 data models are the same here, in my app however, they aren't.
DefaultTableModel model1 = new DefaultTableModel(data, headers);
DefaultTableModel model2 = new DefaultTableModel(data, headers);
DefaultTableModel model3 = new DefaultTableModel(data, headers);
// Init Tables. Tables and ScrollPanes are delcared as final to enable access from within ListSelectionEvent
// Table 1
final JTable jTable1 = new JTable(model1);
jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JScrollPane sp1 = new JScrollPane();
sp1.setViewportView(jTable1);
// Table 2
final JTable jTable2 = new JTable(model2);
jTable2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JScrollPane sp2 = new JScrollPane();
sp2.setViewportView(jTable2);
// Table 3
final JTable jTable3 = new JTable(model3);
jTable3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JScrollPane sp3 = new JScrollPane();
sp3.setViewportView(jTable3);
// Add scrollpanes to panel.
JPanel panel1 = new JPanel();
panel1.add(sp1);
panel1.add(sp2);
panel1.add(sp3);
// Add Panel to frame.
JFrame frame = new JFrame("tableSelection");
frame.add(panel1);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// List Selection Listeners
jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Get the first cell in the selected row, I call it "row key".
String rowKey = jTable1.getValueAt(e.getFirstIndex(), 0).toString();
for(int i = 0; i < jTable2.getRowCount(); i++){
if(jTable2.getValueAt(i, 0).equals(rowKey)){
jTable2.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable2.getCellRect(i, 0, true);
sp2.getViewport().scrollRectToVisible(rect);
break;
for(int i = 0; i < jTable3.getRowCount(); i++){
if(jTable3.getValueAt(i, 0).equals(rowKey)){
jTable3.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable3.getCellRect(i, 0, true);
sp3.getViewport().scrollRectToVisible(rect);
break;
jTable2.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Get the first cell in the selected row, I call it "row key".
String rowKey = jTable2.getValueAt(e.getFirstIndex(), 0).toString();
for(int i = 0; i < jTable1.getRowCount(); i++){
if(jTable1.getValueAt(i, 0).equals(rowKey)){
jTable1.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable1.getCellRect(i, 0, true);
sp1.getViewport().scrollRectToVisible(rect);
break;
for(int i = 0; i < jTable3.getRowCount(); i++){
if(jTable3.getValueAt(i, 0).equals(rowKey)){
jTable3.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable3.getCellRect(i, 0, true);
sp3.getViewport().scrollRectToVisible(rect);
break;
jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Get the first cell in the selected row, I call it "row key".
String rowKey = jTable3.getValueAt(e.getFirstIndex(), 0).toString();
for(int i = 0; i < jTable1.getRowCount(); i++){
if(jTable1.getValueAt(i, 0).equals(rowKey)){
jTable1.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable1.getCellRect(i, 0, true);
sp1.getViewport().scrollRectToVisible(rect);
break;
for(int i = 0; i < jTable2.getRowCount(); i++){
if(jTable2.getValueAt(i, 0).equals(rowKey)){
jTable2.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable2.getCellRect(i, 0, true);
sp2.getViewport().scrollRectToVisible(rect);
break;

New code:
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
* @author Ryan
public class TableSelection {
    public static void main(String[] args){
        // Init data model data.
        Object[][] data1 = new Object[100][5];
        Object[][] data2 = new Object[50][5];
        Object[][] data3 = new Object[50][5];
        for(int i = 0; i < data1.length; i++){
            data1[0] = "Company # " + (i+1);
for(int j = 1; j < data1[i].length; j++){
data1[i][j] = "" + (i+1) + ", " + j;
for(int i = 0; i < data2.length; i++){
data2[i][0] = "Company # " + ((i * 2) + 1);
for(int j = 1; j < data2[i].length; j++){
data2[i][j] = "" + ((i * 2) + 1) + ", " + j;
for(int i = 0; i < data3.length; i++){
data3[i][0] = "Company # " + (i * 2);
for(int j = 1; j < data3[i].length; j++){
data3[i][j] = "" + (i * 2) + ", " + j;
// Init headers.
String[] headers = {"Col 1" , "Col 2", "Col 3", "Col 4", "Col 5"};
// All 3 data models are the same here, in my app however, they aren't.
DefaultTableModel model1 = new DefaultTableModel(data1, headers);
DefaultTableModel model2 = new DefaultTableModel(data2, headers);
DefaultTableModel model3 = new DefaultTableModel(data3, headers);
// Init Tables. Tables and ScrollPanes are delcared as final to enable access from within ListSelectionEvent
// Table 1
final JTable jTable1 = new JTable(model1);
jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JScrollPane sp1 = new JScrollPane();
sp1.setViewportView(jTable1);
// Table 2
final JTable jTable2 = new JTable(model2);
jTable2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JScrollPane sp2 = new JScrollPane();
sp2.setViewportView(jTable2);
// Table 3
final JTable jTable3 = new JTable(model3);
jTable3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JScrollPane sp3 = new JScrollPane();
sp3.setViewportView(jTable3);
// Add scrollpanes to panel.
JPanel panel1 = new JPanel();
panel1.add(sp1);
panel1.add(sp2);
panel1.add(sp3);
// Add Panel to frame.
JFrame frame = new JFrame("tableSelection");
frame.add(panel1);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// List Selection Listeners
jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Get the first cell in the selected row, I call it "row key".
String rowKey = jTable1.getValueAt(e.getFirstIndex(), 0).toString();
for(int i = 0; i < jTable2.getRowCount(); i++){
if(jTable2.getValueAt(i, 0).equals(rowKey)){
jTable2.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable2.getCellRect(i, 0, true);
sp2.getViewport().scrollRectToVisible(rect);
break;
if(i == jTable2.getRowCount() - 1)
jTable2.clearSelection();
for(int i = 0; i < jTable3.getRowCount(); i++){
if(jTable3.getValueAt(i, 0).equals(rowKey)){
jTable3.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable3.getCellRect(i, 0, true);
sp3.getViewport().scrollRectToVisible(rect);
break;
if(i == jTable3.getRowCount() - 1)
jTable3.clearSelection();
jTable2.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Get the first cell in the selected row, I call it "row key".
String rowKey = jTable2.getValueAt(e.getFirstIndex(), 0).toString();
for(int i = 0; i < jTable1.getRowCount(); i++){
if(jTable1.getValueAt(i, 0).equals(rowKey)){
jTable1.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable1.getCellRect(i, 0, true);
sp1.getViewport().scrollRectToVisible(rect);
break;
if(i == jTable1.getRowCount() - 1)
jTable1.clearSelection();
for(int i = 0; i < jTable3.getRowCount(); i++){
if(jTable3.getValueAt(i, 0).equals(rowKey)){
jTable3.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable3.getCellRect(i, 0, true);
sp3.getViewport().scrollRectToVisible(rect);
break;
if(i == jTable3.getRowCount() - 1)
jTable3.clearSelection();
jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Get the first cell in the selected row, I call it "row key".
String rowKey = jTable3.getValueAt(e.getFirstIndex(), 0).toString();
for(int i = 0; i < jTable1.getRowCount(); i++){
if(jTable1.getValueAt(i, 0).equals(rowKey)){
jTable1.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable1.getCellRect(i, 0, true);
sp1.getViewport().scrollRectToVisible(rect);
break;
if(i == jTable1.getRowCount() - 1)
jTable1.clearSelection();
for(int i = 0; i < jTable2.getRowCount(); i++){
if(jTable2.getValueAt(i, 0).equals(rowKey)){
jTable2.getSelectionModel().setSelectionInterval(i, i);
Rectangle rect = jTable2.getCellRect(i, 0, true);
sp2.getViewport().scrollRectToVisible(rect);
break;
if(i == jTable2.getRowCount() - 1)
jTable2.clearSelection();

Similar Messages

  • SQL Server Store Procedure, selecting rows from multiple tables

    i have got a store procedure that is pulling data from one table, now i have got the same data collected in a different table,
    as the IDs are different i cannot put all data from the second table into the first one. so now i have to have two select statements in one store procedure. Although the corresponding data is same but the field names in both table are different. for instance
    BRIEF_TITLE would be briefTitle in the second table. how can i merge the data from two different tables into one. the result is bonded to ASP.net grid view control.

    >> I have a store procedure that is pulling data from one table, now I have got the same data collected in a different table, as the IDs are different I cannot put all data from the second table into the first one. <<
    This is redundancy. The idea of databases even before RDBMS, was to remove redundancy. Oh, columns are not fields. These are basic concepts. 
    >> so now I have to have two select statements in one store procedure. Although the corresponding data is same but the field [sic] names in both table are different.<<
    NO! Where is your data dictionary that assures data elements have one and only one name everywhere in the enterprise!  You are is serious trouble here. The data element names should be universal and used everywhere with the same casing, so that case sensitive
    standards will work. 
    >> for instance BRIEF_TITLE would be briefTitle in the second table.<< 
    The quick kludge is a VIEW with the ISO-11179 names over the camelCase crap
    The moron who did the second table does not know ISO-11179 Standards and missed the research that showed us that camelCase does not work. Your eye is trained to jump to an Uppercase letter since it is the start of a semantic unit (proper name, sentence, paragraph,
    emphasis, etc). When we researched this stuff at AIRMICS, this could add 8-12% to the time to maintain code in large systems. Your eyes twitch! 
    You really need to get your act together with a good text editor/ pretty printer tools. Get a copy of my SQL Programming Style and adapt it to those tools. 
    >> The result is bonded to ASP.net grid view control. <<
    We are the SQL guys; we do not are about the presentation layers :) 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Passing selected rows in a table to Popup Iview

    Hi all,
    I have a main iview in which i search and display some data in a table. Users can select multiple rows from the table and upon clicking on a button in the table toolbar, all the selected rows should be passed to a popup iview.
    But, when i tried, only one value is passed to the popup.
    I need to update a set of rows together from the popup iview.
    Is it a limitation of pop iviews in VC, or did i miss out anything?
    I have selected "multiple select" option for the source table.
    Can anyone advice us on this???
    Thanks alot in advance
    Shobin

    Hi Sreeni,
    Thanks alot for your reply.
    As I saw in some forum posts in SDN, multiple data rows can not be passed to a pop up.
    My application has a list of submitted appointment orders which the authorized person can  approve. I wanted a popup in order to provide a confirmation message when the user multi select and approve many AOs together.
    I found a work around without using pop ups. Instead, I used layers to show the confirmation message. I passed the selected rows to another table using signal in and out.
    It works now.
    Thanks alot
    Shobin

  • I need to divide selected row into multiple rows when i navigate  ADF 11g

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I need to divide selected row into multiple rows when i navigate to other page . Scenario - in first page i'm displaying some records with columns like empno , empstatus , empworkdepts ,curdepts
    Here empworkdepts gives the numeric number like no of departments work shifts 3 or 4 or 5. when i select any particular employee and fire next button to navigate next page.I have to divide the selected employee with same information into multiple times based on the empworkdepts value.
    empno empstatus empworkdepts curdept
    001 eds 2 TS
    002 hr 1 FO
    003 eds 4 TS
    *004 eds 3 TS*
    now i selected employee 004 , when i navigate to next page.
    Empno EmpStatus EmpWorkDepts CurDept
    004 eds 3 TS
    004 eds 3 TS
    004 eds 3 TS
    i did with java code in bean .but not stable .
    any help............
    thanks advance.............
    Edited by: user9010551 on May 5, 2010 10:48 PM
    Edited by: user9010551 on May 10, 2010 11:31 PM

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • Deleting Multiple Rows From Multiple Tables As an APEX Process

    Hi There,
    I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
    On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
    A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
    What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
    BEGIN
    UPDATE tblDebitNotes d
    SET d.Paid = 0
    WHERE 1=1
    AND d.DebitNoteID = :P7_DEBITNOTEID;
    INSERT INTO tblDeletedPayments
    ( PaymentID,
    DebitNoteID,
    Amount,
    Date_A,
    SupplierRef,
    Description
    VALUES
    ( :P7_PAYMENTID,
    :P7_DEBITNOTEID,
    :P7_PAID,
    SYSDATE,
    :P7_SUPPLIERREF,
    :P7_DESCRIPTION
    DELETE FROM tblPayments
    WHERE 1=1
    AND PaymentID = :P7_PAYMENTID;
    END;
    The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
    However this process is not doing anything!! Any insights greatly appreciated.
    Many thanks,
    Gary.

    ...the "button" is using a page level Target,...
    I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
    Scott

  • When iam selecting row of the table i got the exception

    Hi ,
    When iam selecting row in the table at that time iam getting below exceptions
    <21/02/2013 1:31:35 PM EST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /InventoryPropertiesViewTF/InventoryPropertiesView URI: /com/avocent/trellis/apps/mainUi/inventory/pages/fragments/InventoryPropertiesView.jsff actual-URI: /com/avocent/trellis/apps/mainUi/inventory/pages/fragments/InventoryPropertiesView.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'BracketSuffix' returned null
    <21/02/2013 1:31:35 PM EST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /PropertyDisplayTF/PropertyDisplay URI: /com/avocent/trellis/apps/coreapps/ui/fragments/PropertyDisplay.jsff actual-URI: /com/avocent/trellis/apps/coreapps/ui/fragments/PropertyDisplay.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'BracketSuffix' returned null
         at com.sun.el.parser.AstValue.getTarget(Unknown Source)
    Please Let me know why its getting this type exception only some time interemitten issue,
    Please provide me any solution for these,
    jdeveloper 1.1.1.4

    Check your page code for an EL that uses 'BracketSuffix'. This is the point of error as the 'BracketSuffix' can't be evaluated at the given point.
    Timo

  • Get values from selected row in a Table?

    Hello.
    I'm on VC 7.1 (the trial version downloaded from SDN).
    I'm trying to figure out a way to retrieve some values from the currently selected row in a Table element through the output connector.
    I have a web-service which returns results to the Table, and I want the user to be able to select one of the rows and then trigger another web-service call with some of the values from that row -- is this possible?
    Also, I can't find any documentation that lists what can and can't be done with each UI element, is there something like this some where? (the Modeler's guide doesn't help, and the Reference guide seems to focus on menu items and what the VC screen looks like)
    Thanks,
    Alon

    Hi Alon
    This is a very simple task.
    You just need drag the service which you want to execute, after select row, in model.
    Drag output connector from table to input connector of service. Then map the parameter.
    Regards
    Marcos

  • Display and edit currently selected row of ADF Table in ADF Form

    I have an ADF Read-only Table and ADF Form, which were created from the same Data Control.
    I need to be able to edit the selected row of the table in the form (just like in "Binding Data Controls to your JSF page" part of "Developing RIA Web Applications with Oracle ADF" Tutorial). However, I can't figure out how to do this :(
    I found the following solution on the Web: #{bindings.DeptView1.currentRow.dataProvider.dname} - but it doesn't work, since "the class oracle.jbo.server.ViewRowImpl does not have the property dataProvider".
    Sorry for the newbie question.
    Thanks in advance for any help!

    Hi,
    AFAIK, dataProvider is not supported on ADF BC, hence the error.
    If you have created ADF Read only table and form from the same data control you just need to refresh the form based on table selection to show up the selected record, to do which you just need to add partialTriggers property to the panelFormLayout and set its value to the id of table
    Sireesha

  • How to set focus on a input field in a selected row of a table?

    In a previous discussion (http://scn.sap.com/thread/3564789) I asked how to access an input (sap.m.Input) field of a selected row in a table. In the answer that was supplied I was shown how to get the items of the table. Then using the selected index to get the selected item get the cells. Then I could set editable on the proper cell(s). This worked fine.
    Now I need to set the focus on one of the fields. I tried something like this:
                var oNewLink = table.getSelectedItem();
                var oNewLinkName = oNewLink.getCells()[1];
                oNewLinkName.focus();
    But this doesn't seem to work.
    I have searched through other discussions and have seen this technique for putting focus on a field if you have its ID:
    sap.ui.getCore().byId(id_of_the_input_field).$().focus();
    In my case though I do not have an ID since the row and its cells are generated. How can I set focus on the cell of a certain row in a table?

    Hello Venkatesh. Yes that code does work. First I tried it on a table cell that was already rendered and it did work. The next time I tried it on a table row that was being added and it did not work there. So I added an on after rendering function for the table and added that code there. That did not work until I added a delay (timeout) to do a context switch before calling the focus and that worked.
    Once last thing though sometimes when I call focus on an input field (actually in a table row cell) if the field has text in it already the flashing cursor is at the beginning of the text and other times it is at the end of the text (which is the desired way). It depends on where I click in the row. Is there anyway to make sure the flashing cursor is at the end of the text when the focus is applied to a field that contains text?

  • Modifying datatype of columns across multiple tables

    Hi,
    I have a requirement where-in I have to modify the datatypes of columns across multiple tables. Is there any direct way to do this? I mean does oracle has any function or in-built functionality to achieve this.
    Example;
    Table1 -> col1 datatype needs to be changed to varchar2(10)
    Table2 -> col2 datatype needs to be changed to varchar2(30)
    Table3 -> col3 datatype needs to be changed to number.
    and so on....
    Do we have such functionality?
    Thanks,
    Ishan

    Hi Aman,
    Seeing the replies, I think I was unclear in the requirements. But I guess you understood it fully, but still I would like to restate my question once again, just to be 100% sure.
    What I actually want is that in one shot, I would be able to modify columns of multible tables.
    eg, table1-> col1 changed to varchar2(20);
    table2->col2 changed to varchar2(10)
    table3-> col3 changed to number;
    I know how to do it individually, but just wanted to check, if only one command can modify the datatypes of multiple tables/.
    If not, I have already written half the script, but just for knowledge sake wanted to check if some feature is available in oracle for that.
    Regards,
    Ishan

  • Single result set across multiple tables

    Hi - what's the best way to perform a single query that can pull
    a single result set across multiple tables, ie., a master table
    containing subject details and child table containing multiple
    records with detail.
    I know how to do this for two columns in the same table via
    indexing, but how about across tables?
    Cheers,
    John

    I am not sure if I understood your question, but you can use
    Intermedia Text with USER_DATA_STORE to create an index with data
    source from multiple tables.
    (see technet.oracle.com -> products -> oracle text)
    Thomas

  • How do I total across multiple Tables? Help!

    how do I total across multiple Tables? Help!
    I feel like a complete noob.

    Hi Marc,
    There is no function explicitly for that sort of array calculation in Numbers.
    My favorite way is to use a list of Table Names and the INDIRECT(ADDRESS) function combination to produce a SUM across tables. I'm making the assumption that you want to do something like adding up all the values in a particular cell of multiple tables.  For example "give me the total of all the A1 cells in tables T1, T2, T3 and T4".  For this I would use the formula:
    =INDIRECT(ADDRESS(1,1,1,,A))
    to grab the cell contents of the table names mentioned in column A of a summary table.  Once you have them collected in your summary table, add them up.
    Here's a screen shot...
    Hope that gives you an idea for approaching this problem.
    Jerry

  • Inserting records across multiple tables

    I'm still pretty new to working with databases, but have been
    fine using DW to use forms to add, edit and delete records from a
    flat table.
    I'm less sure about updating records across multiple tables,
    for example in a one to many rleationship with a look up table, eg
    If I have three tables
    Companies :
    CompanyID (INT, auto increment)
    Company
    Address
    etc
    Contacts :
    ContactID (INT, auto increment)
    FirstName
    LastName
    etc
    CompanyContacts :
    CompanyID (INT)
    ContactID (INT)
    It's straightforward enough to create pages to insert new
    records into the Companies or Contacts tables, but how do I go
    about populating the CompanyContacts table when I add a new record
    in the Contacts table, so that it becomes 'attached' to a
    particular 'Company'?
    If that makes sense.
    Iain

    I'm still pretty new to working with databases, but have been
    fine using DW to use forms to add, edit and delete records from a
    flat table.
    I'm less sure about updating records across multiple tables,
    for example in a one to many rleationship with a look up table, eg
    If I have three tables
    Companies :
    CompanyID (INT, auto increment)
    Company
    Address
    etc
    Contacts :
    ContactID (INT, auto increment)
    FirstName
    LastName
    etc
    CompanyContacts :
    CompanyID (INT)
    ContactID (INT)
    It's straightforward enough to create pages to insert new
    records into the Companies or Contacts tables, but how do I go
    about populating the CompanyContacts table when I add a new record
    in the Contacts table, so that it becomes 'attached' to a
    particular 'Company'?
    If that makes sense.
    Iain

  • ** Is it possible to give select command from multiple tables in JDBC

    Hi Friends,
    Is it possible to give the select command to select data from multiple tables directly in the 'Query SQL statement' in JDBC sender communication channel ? (Instead of Stored Procedure)
    Thanking you.
    Kind Regards,
    Jeg P.

    Hi,
    here is a sample:
    Table #1
    Header
    Name EmpId Status
    Jai 5601 0
    Karthik 5579 0
    Table #2
    Name Contactnumber
    Jai 9894268913
    Jai 04312432431
    Karthik 98984110335
    Karthik 04222643993
    select Header.Name, Header.EmpId, Item.Contactnumber from Header,Item where Header.Name = (select min(Header.Name) from Header where Header.Status = 0) and Header.Name = Item.Name
    Regards Mario

  • Row selection across multiple tables

    Hi
    I currently have multiple tables where, if the user selects a particular row or group of rows in one table the correspondign row or group of rows is selected in the other table.
    At the moment I've acheived this by placing listSelection listeners on all the tables so that when the selection on one table changes it fires an event and updates the slection on the other tables using:
    secondTable.setRowSelectionInterval(
    firstTable.getSelectedRows()[0],
    firstTable.getSelectedRows()[firstTable.getSelectedRowCount() - 1]
    );This works fine if the user selects a single row or a continuous group of rows. THe problem is if the user selected a non-continuous group, or selects a continuous group and then deselects some of these rows.
    Because the method I've got selects all rows between the start and finish of the selection it means rows are highlighted on the other tables that are not highlighted on the first table.
    My thoughts on how to approach this would be to cycle through the array of selected rows and select the corresponding rows in the other tables individually rather than selecting a range, but I can't see how to accomplish this. Could anyone give me some pointers or suggestions.
    Thanks

    What you are doing is correct in principle (use a
    listener to propagate the selection)
    Always a good start :-)
    but you need to
    understand the subtleties of the ListSelectionEvent -
    read the API carefully - it gives you a range of
    indices which may have changed but does not tell you
    whether any specific indices in that range are
    selected or unselected.
    That makes sense, the event just indicates that the selection has changed yes?
    For that you will need to get
    the source ListModel from the event and query each
    row in the event range to determine its selection
    state.
    This is where I run into difficulty. I think I can go through the each row and find out if its selected or not (using isSelectedIndex(i))
    What I'm unsure what to do is how to set that for the rows in the other ListModels. What I would have normally done would be something like
    otherListModel.getIndex(i).setSelected(firstListModel.isSelectedIndex(i));But as the api doesnt list the methods to do that I think I might not have got this concept sorted in my head. Could someone provide me with some pointers?
    Thanks

Maybe you are looking for

  • Photoshop CS4 crashes everytime I close the program

    Although Photoshop CS4 is running fine on my 2008 Imac 2.8 ghz, when I close the program it crashes, before I reinstall it, is there anything I can do to hopefully fix the issue? Of note here: I have some Onone software plug ins installed, its weird

  • Suggestions for Preview app features (Snow Leopard)

    There's lot's to like in the new Preview app, but I'd like a few more things: 1. Ability to edit and reorder Tables of Contents. 2. Ability to reorder Bookmarks (and to hierarchically group them) 3. Sensible control over formatting of links. Thanks

  • Oracle Locator - Implementation

    I have a need to calculate shortest distance between any two locations (addresses) using Oracle Locator. The only parameters that are available to me as inputs are the 5 digit zip code, latitude and longitude of the location. I am looking for help in

  • Regarding RFC adapter

    Hi     when we r using RFC adapter on sender side it asks fgor 'RFC  Program id' what we have to mention in it.    Regards   maheswararao

  • I cant put the code in doesnt allow me to put letters only numbers

    what should i do