Change Selection of two Tables within an JSplittPane

Hi,
i have two JTables within an J Splitpane. Table a is the top component and table b is the bottum component. each table could be selected. how could i manage it, that either table a is selected or table b. the selection should change between the tables, if i click with the mouse in one of both tables.
thx and regards wanderlust

Be extremely careful when you do this!
If you have list A that is listening and changing its selectoin based on List B's change selection events, and List B is also listening and changing its selection based on List A's change events, you create a loop.
Thus you will have infinite change selection events, causing a stach overflow.
Just a word to the wise...
-jonathan

Similar Messages

  • Selecting from two tables but making it just one selection

    Is there a way to select from two tables and just have one selection appear?
    Specifically I have a fact_install_unit, and a fact_install_arch table.
    Sometimes the value exists in fact_install_unit.factory_timestamp, and sometimes when fact_install_unit.factory_timestamp is null I need to pull it from the fact_install_arch.factory_timestamp.
    sort of like:
    (select fact_install_unit.factory_timestamp
    from fact_install_unit, fact_install_arch
    where fact_install_unit.fl_unit_sak = fact_install_arch.fl_unit_sak
    and where fact_install_unit.factory_timestamp is null then display fact_install_arch.factory_timestamp)

    > I was just stating that I do not have sufficient priveleges to create views in this database.
    >
    nm means "no more" than that
    And how are we supposed to know that? You seem to have changed the thread subject to "unfortunately I only have read-only and insufficient priveleges", which is not even a question.
    nm means "New Mexico":
    http://www.myshortpencil.com/schooltalk/messages/85/515.html?971794944

  • Select from two tables and insert into a third

    I'm trying to do a select from two tables and do an insert into a third table from the two resulting columns.
    I have the following....
    DECLARE
    tempsid number;
    temphostid number;
    BEGIN
    select "DBSID_ID","ID" into tempsid,temphostid from "DBSIDS","SERVERS"
    where "HOST_SID" like '%'||"DBSID_NAME"||'%'
    and "HOST_NAME" not like 'vio%'
    and exists (select "DBSID_NAME" from DBSIDS)
    order by "DBSID_NAME";
    insert into "DBSID_LOOKUP" ("SIDLOOKUP_ID", "SERVERLOOKUP_ID")
    values(tempsid, temphostsid);
    END;
    run;
    I get the error ....
    ORA-06550: line 11, column 18:
    PL/SQL: ORA-00984: column not allowed here
    ORA-06550: line 10, column 1:
    PL/SQL: SQL Statement ignored
    1. DECLARE
    2. tempsid number;
    3. temphostid number;

    okay ... I tried a different way ...
    DECLARE
    a number;
    b number;
    BEGIN
    select "DBSID_ID","ID" into a,b from "DBSIDS","SERVERS"
    where "HOST_SID" like '%'||"DBSID_NAME"||'%'
    and "HOST_NAME" not like 'vio%'
    and exists (select "DBSID_NAME" from DBSIDS)
    order by "DBSID_NAME";
    insert into "DBSID_LOOKUP" (SIDLOOKUP_ID, SERVERLOOKUP_ID) values (a, b);
    END;
    and now it whines about ...
    ORA-01422: exact fetch returns more than requested number of rows

  • Selecting from two tables and confirming from them despites they not relate

    Please I need a query to select from two tables that are not related to each other.
    I also want to confirm data's as in verify wether what the user has entered is in accordance with what is in the tables
    Examples
    the first table is named "Card" and the second table is named "Student_Details"
    Card table contains a column named "Pin_Number".
    The Student_Details table contains fields such as Exam_Number, Name, Age, Sex.
    The user has to Enter the Pin_Number which has to be confirmed in the Card table and Exam_Number which has to be confirmed in the Student_Details table and verify that both data's are correct.
    Please I need the SQL and PL/SQL queries for this problem.
    Thanks

    Hi,
    I think you need two different queries
    You can write a procedure like:
    create or replace procedure p1 (p_pin_number number, p_exam_number)
    is
      r_card_row            card%rowtype;
      r_student_details     student_details%rowtype;
      cursor c1 is
      select *
        from card
       where pin_number = p_pin_number;
      cursor c2 is
      select *
        from student_details
       where exam_number = p_exam_number;
    begin
      open c1;
        loop
          fetch c1 into  r_card_row;
          exit when c1%notfound;
          ....  do whatever you want..... and the samething you can do with other cursor
        end loop;
      close c1;
    end p1;Hope this helps
    Ghulam

  • If I have an EntityBean that mappes to two tables within one database, when I create that EJB, whoes reponsibilty to generate the primary key in database table? The RDBMS or EJB?

    If I have an EntityBean that mappes to two tables within one database, when I create
    that EJB, whoes reponsibilty to generate the primary key in database table? The
    RDBMS or EJB?
    Thanks,
    JW

    Refer to http://e-docs.bea.com/wls/docs81/faq/ejb.html/#257430
    "Jingwei Zhang" <[email protected]> wrote:
    >
    If I have an EntityBean that mappes to two tables within one database,
    when I create
    that EJB, whoes reponsibilty to generate the primary key in database
    table? The
    RDBMS or EJB?
    Thanks,
    JW

  • Maintain Change log between two tables

    Hi,
    I have input data as below in two tables temp1,temp2.
    I need to find the difference then maintain a change log as below;
    so I need query to get output in this way;
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.

    you cannot have same name for two coloumns in a single select statment .
    so name its with alias name such as colName and colName1
    select T.colName as colName, T1.colName as ColName1 ,T.TableName as tableName, T1.TableName as tableName1 ,T.dataType as datatype, T1.Datatype as datatype1 , T.ColLength as column Lenghth, T1.colLength as Collength1,
    (IF (T.colName = T1.colName  and T.TableName and ...compare rest of the columns)  THEN match
    ELSE IF (T.colName <> T1.colName) THEN ColumNamechanged
    ELSE IF (next colunm name) THEN changedcolname
    ELSE
    FROM temp1 T ,temp2 T1)
    AS change
    FROM temp1 T ,temp2 T1) as chages
    from temp1 T ,temp2 T1 where T.colName = T1.colName  ;

  • Selecting from two tables

    I have two tables:
    TABLE: users (user_is is primary key):
    ++++++++++++++++++++++++++++++++++++++
    user_id     | username
    1     | fazle
    2     | newaz
    3     | shaerul
    4     | badsha
    5     | mirmohsin
    6     | mdmohsin
    7     | shawkat
    8     | ahsan
    9     | admin
    TABLE: key_movement_history (history_id is primary key, key_handover_user_id and     key_takeover_user_id links to users.user_id):
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    history_id     | handover_date     | key_handover_user_id |     key_takeover_user_id
    1     | 2006-10-18 16:25:07     | 8               |      2
    2     | 2006-10-18 17:03:09          | 2               |      8
    3     | 2006-10-18 17:04:45     |     8               |     1
    4     | 2006-10-18 17:28:35     |     1               |      8
    5     | 2006-10-18 17:31:59          | 8               |      1
    6     | 2006-10-19 19:04:02          | 1               |     8
    What is want is:
    TABLE 3:
    ++++++++
    handover_date     | key_handover_username | key_takeover_username
    2006-10-18 16:25:07     | ahsan     | newaz
    2006-10-18 17:03:09     | newaz          | ahsan
    2006-10-18 17:04:45     | ahsan          | fazle
    2006-10-18 17:28:35     | fazle          | ahsan
    2006-10-18 17:31:59     | ahsan          | fazle
    2006-10-19 19:04:02     | fazle          | ahsan
    Could anyone please tell me the select statement?
    I tried
    SELECT key_movement_histories.handover_date, users.username, users.username FROM key_movement_histories, users WHERE users.user_id = key_movement_histories.key_handover_user_id and users.user_id = key_movement_histories.key_takeover_user_id;
    but this did not work.
    Thanks in advance.
    Message was edited by:
    user538091

    sql>select * from t1;
        USER_ID  USERNAME
        1  Fazle 
        2  Nawaz 
        3  Sherul
    sql>select * from t2;
        HISTORY_ID  DT  HO_ID  TO_ID
        1  06-oct-06  1  2 
        2  16-oct-06  2  3 
        3  26-oct-06  3  1
    sql>select t2.history_id,t2.dt,
           t11.username ho_user,t12.username to_user
        from t1 t11,t1 t12,t2
        where t11.user_id = t2.ho_id
        and t12.user_id = t2.to_id;
        HISTORY_ID  DT  HO_USE  TO_USE 
        1  06-oct-06  Fazle  Nawaz 
        2  16-oct-06  Nawaz  Sherul 
        3  26-oct-06  Sherul  Fazle 
    jeneesh

  • SELECT from two tables

    Hello, I have a problem writing a specific SELECT statement and I hope you'll help me out.
    I have two tables:
    Clients:
    - ID integer (PK)
    - Name_SecondName varchar(20)
    - Gender char
    - Balance integer
    Investments:
    - ID integer (PK)
    - Amount integer
    - Interest Numeric(3,2)
    - Client_ID (FK)
    My job is to display a number of men and a number of women who have at least one investment higher than $1000. I'll skip adding the data to the table, my point is just to find a proper construction for the SQL query. Right now I've got this:
    SELECT COUNT(DISTINCT Client_ID), COUNT(DISTINCT Client_ID)
    FROM Clients JOIN Investments
    ON Clients.ID = Investments.Client_ID
    WHERE Amount > 1000;
    Obviously it twice displays the number of clients with an investment higher than $1000. But how do I specify that the first COUNT counts men (Gender='M') and second - women (Gender = 'F') ?? Can anyone help me?
    Edited by: 934019 on 2012-05-13 12:10

    I'm using Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    Here's the code:
    CREATE TABLE Clients
    Client_ID INTEGER PRIMARY KEY,
    Name_SecondName VARCHAR(20),
    Gender CHAR,
    Balance INTEGER
    CREATE TABLE Investments
    Investment_ID INTEGER PRIMARY KEY,
    Amount INTEGER,
    Interest NUMERIC(3,2),
    Client_ID INTEGER REFERENCES Clients(Client_ID)
    INSERT INTO Clients VALUES (1, 'Brad_Pitt', 'M', 100000);
    INSERT INTO Clients VALUES (2, 'Angelina_Jolie', 'F', 200000);
    INSERT INTO Clients VALUES (3, 'George_Clooney', 'M', 250000);
    INSERT INTO Clients VALUES (4, 'Meryl_Streep', 'F', 150000);
    INSERT INTO Clients VALUES (5, 'Colin_Farrell', 'M', 200000);
    INSERT INTO Clients VALUES (6, 'Scarlett_Johansson', 'F', 400000);
    INSERT INTO Investments VALUES (1, 10000, 4.25, 4);
    INSERT INTO Investments VALUES (2, 20000, 4.65, 3);
    INSERT INTO Investments VALUES (3, 15000, 3.85, 2);
    INSERT INTO Investments VALUES (4, 30000, 4.85, 6);
    INSERT INTO Investments VALUES (5, 25000, 4.5, 3);
    INSERT INTO Investments VALUES (6, 15000, 4.35, 5);
    INSERT INTO Investments VALUES (7, 20000, 4.75, 6);
    INSERT INTO Investments VALUES (8, 10000, 4.15, 1);
    INSERT INTO Investments VALUES (9, 25000, 4.6, 3);
    INSERT INTO Investments VALUES (10, 20000, 4.15, 4);
    And now I make a SELECT statement as follows:
    SELECT COUNT(DISTINCT Client_ID), COUNT(DISTINCT Client_ID)
    FROM Clients NATURAL JOIN Investments
    WHERE Investments. Amount > 15000;
    The result is:
    COUNT (DISTINCT Client_ID) *3*
    COUNT(DISTINCT Client_ID) *3*
    It now displays '3' because there are 3 clients who have at least one investment higher than 15000 (George Clooney, Meryl Streep and Scarlett Johansson).
    So again the question is how to make the first COUNT count only men and the second COUNT - only women? I don't want it to display the clients - just the number of them.

  • Select from another table within a select

    Hello all,
    Here is my problem. I am working with thousands of records in each of the tables I am accessing. In the following code it takes about 1min-2min to process this select statement. I get the results I want but the query time is unacceptable. With all of my queries combined it would take over 10 days to complete this code. I would like to cut this time down as much as possible and feel this is the only way to achieve this. I have also tried temp tables to store the rows from the second select statement, no luck. Any input would be greatly appreciated.
    Thanks
    select count(*)
         from first_table
         where id='1'
                   and contract_year='2006'
                   and site_code='00007'
                   and district='00002'
                   and std_id in (select std_id from second_table where attempt = 'Y' and scale ='Y');     

    A few thoughts. First, you could try this...
    SELECT COUNT(*)
    FROM   first_table a,
           second_table b
    WHERE  a.id='1'
    AND    a.contract_year='2006'
    AND    a.site_code='00007'
    AND    a.district='00002'
    AND    a.std_id = b.std_id
    AND    b.attempt = 'F'
    AND    b.scale = 'Y';If you have no indexes, you could try the PARALLEL hint to improve the query. You could CACHE one or both tables to improve performance. Of course, indexes are always a preferred option!. As a final thought, if this is really going to take 10 days, perhaps the procedure(s) you are executing are inherently inefficient. You might want start there first.
    Greg Pike
    http://www.singlequery.com

  • How to select a new table in logical database after creating the Infoset

    I have created a abap query report ,i have used logical data base ADA in the infoset in SQ02.In the logical database i had selected only two tables then ANALV and ANLB.Now my client wants one more field to be added and thats is from table ANEK.Now i need to select this table in logical database ADA.
    Please assist on how to select another table available in the Logicaldata base now which i didnt select when i created the query

    Markus,
    I have now selected the additional field Posting date in Document ANEK -BUDAT .Earlier the report had the fields from ANLCV - Current acquisition value ,ordinary dep posted selected for  the output.
    When i run the query after adding this new field ANEK-BUDAT the below warning  is generated  by system :
    The query specifications cannot be used to generate a list,
    i.e. the query will probably not return the list you desire.
    If you still want to execute the query, please use the
    "Generate" function
    -> 'Generate'
    Fields from parallel tables within a line*
    Line: 01
    Field: Posting Date in the Document
    (ANEK-BUDAT, table ANEK)
    Field: Ordinary depreciation posted
    (ANLCV-NAFA GEB, table ANLCV)
    Fields from parallel tables within a line*
    Line: 01
    Field: Posting Date in the Document
    (ANEK-BUDAT, table ANEK)
    Field: Current asset acquisition value
    (ANLCV-LFD KANSW, table ANLCV)
    2 warnings for query QUERY ***
    Please advice .How get this new field added.

  • Urgent. . .About select * from multiple tables

    When I am doing the 'Select * from tables' in JSP,
    sql = dbconn.prepareStatement("SELECT * FROM protein WHERE protein_id ='"+p_i+"'");
    It works, because I only select one table.
    Then, I change to select from two tables,
    sql = dbconn.prepareStatement("SELECT * FROM protein, fuses WHERE protein_id ='"+p_i+"'");
    It also works properly?
    However, When I do like:
    sql = dbconn.prepareStatement("SELECT * FROM protein, protein_taxa WHERE protein_id ='"+p_i+"'");
    It doesn?t work.
    So, I think it might be the problem that there is a common column 'protein_id' in both tables, although protein_taxa.protein_id is a foreign key of protein.protein_id. Therefore, I can select two table protein, fuses which have different columns, but no way to select the table they have same name column.
    However, it?s essential for me to select all the data from the database. Any way I could achieve it? Thanks a lot!!

    SELECT *
    FROM protein, protein_taxa
    WHERE protein.protein_id = 'a_protein_id'
    and protein.protein_id = protein_taxa.protein_id It would also be good to indicate which fields you want on the select clause. This will liberate the server to return two fields with the same name.
    SELECT protein.protein_id, protein.name, protein_taxa.taxa /* ??? */
    FROM protein, protein_taxa
    WHERE protein.protein_id = 'a_protein_id'
    and protein.protein_id = protein_taxa.protein_id

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • How to compare substring in two tables fields

    Hi ABAP expert,
    When I want to select database two tables, we just want to compare two table substring. For Example, both fields have yyyymmdd. But I have interested yyyymm. In the Oracle database and SQL server database, I can easily to use substr to achieve those goals. How in the ABAP program to archive those goals.
    Thanks in advance,
    Cliff Fan

    Hi you can access substrings in ABAP the following way:
    data: s type string value 'yyyymmdd'.
    write: / s(6). "yyyymm
    write: / s+4(4). "mmdd
    so the number after '+' determines the position in the string and the number in parenthesis () determines the length of the substring.
    Now you can just loop over both of your tables and perform the necessary comparison in the nested loop.

  • Selection from different tables

    Hello Everyone,
    I have a situation where I have 15 fields in the selection screen.
    The selection is dependent on three or more tables.
    First I have selected from two tables but if the user enters values in the selection screen then how to make the selection.
    Tables dont have common fields between them. LIKP, LIPS, VTTK, VBUK and VEKP are the tables.
    Can you guys guide me.
    Thank you.

    Hi Vinod,
    First I have selected from two tables but if the user enters values in the selection screen then how to make the selection.
    Your query is not so clear. When are you fetching the data from two table whether before selection screen input (Initialization event) or after selection screen?
    Can you please elaborate your query and better if you post your Selection Screen screen-shot.
    Regards,
    VIjay

  • Table structure changes when using 'create table X as ( select * from X@remote_server )'

    I need to create and copy data from a remote Oracle server to a local server. The command I use is
    create table X as ( select * from X@remote_server )
    with remote_server is the tns name of the remote Oracle server.
    The local table is created and populated with data as expected but when I check the structure using 'desc X' it shows me all the CHAR fields of the local table are triple as large as of the remote table.
    I guess the problem is the difference  between the NLS_CHARACTERSET settings . The local charset is AL32UTF8 and the remote is  WE8MSWIN1252.
    How do I change the command to make the two tables have the same field sizes ?
    Thanks,
    Vu

    Do you want to be able to store all the data from the remote table in the local table?  Assuming you do, increasing the size of the column would be the correct behavior.
    By default, a VARCHAR2(10) allocates up to 10 bytes of storage.  In the Windows-1252 character set on the source, 1 character requires 1 byte of storage.  So a VARCHAR2(10) has space for up to 10 characters.  In the UTF-8 character set on the destination, however, 1 character can require up to 3 bytes of storage.  So a VARCHAR2(10) may allow you to store as few as 3 characters.  Since Oracle has no way of knowing what data you have (and will have) in the source system, it triples the size to ensure that all the data from the remote system will fit in the new table.  If you want the columns to be the same size on the destination that they are on the source, it is highly probable that you'll get errors inserting the data because at least one value will be too large for the destination column.
    Justin    

Maybe you are looking for

  • Excise Invoice Problem

    Hi All,          I have posted the Excise Invoice. 1. but in item level GR reference Tab is missing. 2. Qty Tab - (Relevent to Part 2) Qty is coming both credit availed & Credit available.but it should come only credit availed. 3.Duty value Tab - Exc

  • OdiStartScen in async mode: variables lost in execution queue

    I have the following case: - a scenario must be called for each row in a database table - this scenario has a variable, declared in the scenario parent package: variable values are read from the table - rows are more than the "maximum number of sessi

  • ARC 3.3 and not 4.1

    Dear All, I have just installed CS3, which I am very happy with all the new features and most importantly, it's Universal and it runs perfectly in my Intel-iMac! However, I do notice that in my Camera Raw dialog box, in the ACR, it still shows versio

  • Update firefox to 36.0 Yahoo toolbar only has mail Everything else gone 35.0 was OK How do I get back 35.0?

    Question above states it all. I reinstalled Yahoo toolbar. No help. I do have the Yahoo toolbar but all my customizing is gone on it. I can't right click on toolbar to add stuff. I made the mistake of updating to Fox 36 on three different computers.

  • Error installing Indesign CC

    Hi, my boss from a remote company has shared her Adobe CC with me for Indesign. I tried installing it over and over again with the same error. before the error message pops up but now requires me to restart over and over again and nothing happens whe