RadioButtonSelectedOrNot[index] = bind radioButton[index].selected  problem

Could someone please tell me why *radioButtonSelectedOrNot[index] = bind radioButton[index].selected;* is not working?
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.control.*;
def toggleGroup = ToggleGroup {};
var radioButton: RadioButton[];
var message: String[];
var radioButtonSelectedOrNot: Boolean[];
message[0] = "Display a slide show of car images.";
message[1] = "Display the Car Race Simulation";
message[2] = "Exit";
for (index in [0..2]) radioButton[index] = RadioButton
    toggleGroup: toggleGroup
    text: "{index + 1} {message[index]}"
for(index in [0..2])
    radioButtonSelectedOrNot[index] = bind radioButton[index].selected; // WHY ISN'T THIS WORKING?!
def stage1 = Stage
    scene: Scene
        width: 600
        height: 400
        content:
            VBox
                spacing: 5
                content:
                    radioButton[0],
                    radioButton[1],
                    radioButton[2]
}Any input would be greatly appreciated!
Thanks in advance!

Maybe this will help you.
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.control.*;
def toggleGroup = ToggleGroup {};
var message: String[] = ["Display a slide show of car images.",
            "Display the Car Race Simulation",
            "Exit"];
var radioButton: RadioButton[] = [for (index in [0..2]) { RadioButton {
                    toggleGroup: toggleGroup
                    text: "{index + 1} {message[index]}"
var radioButtonSelectedOrNot: Boolean[] = bind for (index in [0..2]) { radioButton[index].selected };
def stage1 = Stage {
            scene: Scene {
                width: 600
                height: 400
                content: [
                    VBox {
                        spacing: 5
                        content: [
                            radioButton
        }

Similar Messages

  • How to capture indexes of multiple rows selected in Advance list

    Hi,
    - I have a prefilled advance list with multiselection enabled.
    - There is a button, associated with an action,which is bind to a eventHandler,that event Handler has script operation which conains the ruby scrpt code.
    - Now when i select multiple rows of that advance list and click on the action,I want to capture the indexes of all the selected rows.
    I tried using following ruby code:
    lead=$data.datalist.LeadSelectedIndex
    But it returns index of only first row selected out of various rows selected.
    So please anyone help me on that.
    Regards ,
    Saurabh Sharma.

    In FP2.6 there is no chance from SDK to have a mass enabled Action and bind to a mulli selection list as a BO Action in the UI Designer, as multiplicity will always be single and only lead selection would be selected.
    this feature comes only in FP3.0.
    So i am not sure what excatly Saurabh wants to do : maybe do some calculations based on multi seletions then i would do the following as also what Christian mentioned
    multiSelect =  ($data.DataList.GetSelectedRowsCount() > 1);
    NoOfRowsSelected = $data.DataList.GetSelectedRowsCount();
    SummationField = 0;
    if ( multiSelect )
       LeadSelection = $data.DataList.LeadSelectedIndex;
       RequiredDataField = $data.DataList.Get(LeadSelection).AnydataField;
       for i in 0..(NoOfRowsSelected - 1)
         currentRow = LeadSelection + i;
          RequiredDataField = $data.DataList.Get(currentRow).AnydataField;
    // imagine this is just add values of the RequiredDataField
         SummationField = SummationField +   RequiredDataField
       end
    end
    So i have not tried this directly - but i hope i make the idea clear.
    Regards,
    Nitesh Pai

  • DB 13 Message logs BR0988W Bitmap index /BI0/F0COPC_C08~08 selected for che

    Dear Exprts,
    We are getting following error in DB13 check DB, our server is BW Test and version BW3.5.
    Kindly Suggest.
    BR0988W Bitmap index /BI0/F0COPC_C08~08 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0CO
    BR0988W Bitmap index /BI0/F0LSO_C01~020 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0LS
    BR0988W Bitmap index /BI0/F0LSO_C02~050 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0LS
    BR0988W Bitmap index /BI0/F0PAPA_C02~11 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0PA
    BR0988W Bitmap index /BI0/F0PE_C01~050 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0PE_
    BR0988W Bitmap index /BI0/F0PE_C02~050 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0PE_
    BR0988W Bitmap index /BI0/F0PE_C03~050 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BI0/F0PE_
    BR0988W Bitmap index /BIC/FC_0IC_C03~11 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_0
    BR0988W Bitmap index /BIC/FC_0SD_C03~12 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_0
    BR0988W Bitmap index /BIC/FC_AS_ROM~060 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_A
    BR0988W Bitmap index /BIC/FC_BOL_BU~900 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_B
    BR0988W Bitmap index /BIC/FC_BOL_DBL~07 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_B
    BR0988W Bitmap index /BIC/FC_BOL_RTL~07 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_B
    BR0988W Bitmap index /BIC/FC_CUST_MA~04 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_C
    BR0988W Bitmap index /BIC/FC_FRSRCP~110 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_F
    BR0988W Bitmap index /BIC/FC_HITMISL~08 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_H
    BR0988W Bitmap index /BIC/FC_HITMISS~08 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_H
    BR0988W Bitmap index /BIC/FC_MRL_RTL~06 selected for checking statistics - please activate the monitoring attribute for table SAPBWD./BIC/FC_M
    Regards
    Yogesh

    Hi,
    check SAP Note Note 442395 - Descriptions of specific BR messages
    search for BR0988W in note.
    then Activate the MONITORING attribute for the table in question as per note.
    also check Note 408527 - Checking the statistics using DBA_TAB_MODIFICATIONS
    regards,
    kaushal

  • How to Return the Index of a Mouse-Selected Array Element in the View Interface of Diadem

    Hello,
    Does anybody have an idea of how to obtain the index of a mouse-selected array element in the View interface of Diadem??
    Thanks!

    Hi Ovidius,
    Keep explaining.  The only way I know of to trap a selected cell value in VIEW is to embed into the desired VIEW area a second non-modal SUDialog that has a Table control or an XTable control displaying the values of certain data channels.  There are callbacks in both table controls for cell selection, and you can configure the table control to allow only single cell selection if that's what you want.  The regular table control will be easier to program, but the XTable control will perform much better for larger channels.
    But what happens with that value the user selected?  Is it used for a calculation?  Is it added to a report?  Why would the user select that cell in a table rather than selecting the corresponding feature in a graph with the crosshair cursor?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • "analyze index"  vs  "rebuild index"

    Hi,
    I don't undestand the difference between "analyze index" and "rebuild index".
    I have a table where I do a lot of "insert" and "update" and "query", What is the best thing to do ??
    thanks
    Giordano

    When you use dbms_stats.gather_schema_stats package with cascade=>true option, you are also collecting stats for the indexes, no need to collects stats separately using dbms_stats.gather_index_stats.Of course, but I refered to the rebuild index question. Therefore I only mentioned the GATHER_INDEX_STATS.
    Auto_sample_size has many problems/bugs in 9iOk didn't know that - I'm using 10gR2.
    But this discussion made me curious. So I tried something (10gR2):
    CREATE TABLE BIG NOLOGGING AS
    WITH GEN AS (
    SELECT ROWNUM ID FROM ALL_OBJECTS WHERE ROWNUM <=10000)
    SELECT V1.ID,RPAD('A',10) C FROM GEN V1,GEN V2
    WHERE ROWNUM <=10000000;
    SELECT COUNT(*) FROM BIG;
    COUNT(*)
    10000000
    So I had a Table containing 10 Million rows. Now I indexed ID:
    CREATE INDEX BIG_IDX ON BIG(ID)
    I tested two different methods:
    1.) GATHER_TABLE_STATS with estimate 10%
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>10);
    It took about 6 seconds (I only set timing on in sqlplus, no 10046 trace) Now I checked the estimated values:
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'TABLE' OBJECT FROM USER_TABLES WHERE TABLE_NAME='BIG'
    UNION ALL
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'INDEX' OBJECT FROM USER_INDEXES WHERE INDEX_NAME='BIG_IDX';
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9985220 998522 ,1478 TABLE
    9996210 999621 ,0379 INDEX
    2.) GATHER_TABLE_STATS with DBMS_STATS.AUTO_SAMPLE_SIZE
    EXEC DBMS_STATS.DELETE_TABLE_STATS(OWNNAME=>'DIMITRI',TABNAME=>'BIG');
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE);
    It took about 1,5 seconds. Now the results:
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9826851 4715 1,73149 TABLE
    10262432 561326 2,62432 INDEX
    The estimate 10% was more exact - also a 1,7 and 2,6 percent variance is still ok. It's also very interesting, that using AUTO_SAMPLE_SIZE
    causes oracle to execute a estimate 5% for the index and a estimate 0.5 for the table.
    I tried again with a table containing only 1 Million records and oracle did an estimate with 100% for the index.
    So for me I will continue using AUTO_SAMPLE_SIZE. Its very flexible, fast and accurate.
    Dim
    PS: Is there a way to format code like one can do in HTML using <code> or <pre>?

  • Random array sound selection problem

    Hello,
    I'm a gigantic AS3 noob so please be gentle with me. I have probably simply done something very stupid.
    I have an animated character and a set of footstep sounds, and have set up code so that at a set point in the walk cycle a random footstep sound is played based on frame label selection. The following code is in the character movieclip:
    function getRandomLabel():String {
      var labels:Array = new Array("step1", "step2", "step3", "step4","step5", "step6", "step7", "step8");
      var index:Number = Math.floor(Math.random() * labels.length);
      trace (labels[index])
      return labels[index];
    step1, 2 etc refer to the frame labels of the sound movieclip I have nested inside the character movieclip, which contains the eight sounds on 8 frames with appropriate labels (plus an additional blank frame at the beginning).
    At the frames in the character animation where I wish a footstep sound to play, I have the code:
    this.soundtest.gotoAndStop(getRandomLabel());
    'soundtest' is the name of the sound movieclip containing the footsteps. This works perfectly; I get a random sound at the right time on each footfall. The weird problem is that if the random label index returned is the same as the previous one (i.e. step1 and step1 again) the second sound does not play. This only happens if the same label is repeated, otherwise it works fine. So the footsteps have occasional breaks in them where 'something' prevents repeat sounds/array indices being played. What could be the problem here?
    Thanks in advance.

    If you are going to and stopping at the same frame you are already in you are not going and stopping anywhere, so the sound does not re-execute as if you just entered the frame.
    You should look into loading the sound dynamically if you want an approach to have the same sounds repeatable.  That way you don't need to move around a timeline.
    If that's too much for you to want to try to tackle (it is not difficult) then an alternative could be to avoid repeating the same sound by putting in some conditional logic in your function that checks if the currently selected sound is a repeat of the one just played, and if so, pick another... until a non-repeat is selected.

  • How to bind a user selected value to a view object bind variable?

    Hi
    I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
    when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
    to display the columns i have used the query
    Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
    now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
    thanks
    swathi.

    Hi,
    depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
    Frank

  • Compound index vs separate indexes

    Hi,
    I am having a table with 12 million records.
    My query will be always having 2 conditions in WHERE clause.
    SELECT * FROM TABLE WHERE c1='some integer' and c2 in (some values)In this case which index will be appropriate.?
    a)Creating separate indexes on c1 and c2
    b)creating a compound index on (c1,c2)
    What are the things i need to consider before creating index in this case>
    Thanks

    >
    In this case which index will be appropriate.?
    a)Creating separate indexes on c1 and c2
    b)creating a compound index on (c1,c2)
    What are the things i need to consider before creating index in this case>
    >
    Well I must say I disagree with ALL of the answers provided so far because none of them take into account those 'things you need to consider' before creating an index (or indexes).
    1. What is the selectivity of column C1? How many distinct values? How are the data values clustered?
    2. What is the selectivity of column C2? How many distinct values? How are the data values clustered?
    3. What will the clustering factor of the index be? That is, is the table data in any particular order that would result in an exceptionally good, or poor, cluster factor for the index?
    4. Will any queries only need column 'c2' for filtering?
    5. Will any queries only need column C2 for filtering?
    Without knowing at least the above information there is no way to tell if ANY index is appropriate, let alone how many or the ordering of columns for a composite index.
    Just consider point #1 above. If there are only two values for C1 and 6 million records have each value what good would an index be?
    But if column C1 is unique then an index would be very selective and you don't need to consider the C2 value at all.
    Likewise if the cardinality of C1 is low (few records have the same value) but cardinality of C2 is high the index should be on C1 only since including C2 would dilute the index and require more records to be read to get the ROWIDs of interest. And in cardinality of C2 is low but C1 is high then C2 might be better as the lead colum since an INDEX SKIP SCAN could be used.
    If you can provide the information asked for above then better recommendations can be provided.

  • Compund index vs simple index

    I want to know the differece between a compund index and a simple one.
    For example I have a compund index with three fileds: field1, field2, field3
    index type 1:
    create index index1 on table1 (field1, field2, field3);
    What happen if I change this compund index for a simple one?, something like this:
    index type 2:
    create index index1 on table1 (field1);
    create index index2 on table1 (field2);
    create index index3 on table1 (field3);
    I think that index type 2 (simples one) takes more space than index type 1, isn't it???
    I think index type 1 is more effective in a sql with all the indexed fields in the where, something like that: select * from table1 where field1 = ' ' and field2 = ' ' and field3 = ' ', but in any other sql is more effective index type 2 , isn't it???
    is that true??, any other difference?
    Any advice or design criteria about indexes (compund or simple) will be greatly appreciatted.
    Thanks in advance

    In my opinion most important thing between two is first has one index and the other has three :) Indexes result more I/O activity on update, insert and delete operations on the related table. So they need to be choosen carefully if you are creating them over heavily loaded oltp tables.
    Also according to your query's where clause first index will be more selective, effective but this needs to be tested.

  • SOLUTION - Re-Index Loops when "Index Now" button is broken

    This message is for anyone having trouble with Soundtrack's loop indexing in the following way:
    PROBLEM:
    ... You want to re-index some loops, or
    ... You want to de-index some loops, or
    ... Some loops are showing up red
    AND...
    ... You cannot re-index from the "Setup..." button in the Search palette (the minus button and/or "Index Now" buttons are grayed out for some unknown reason)
    *HERE IS THE POSSIBLE SOLUTION:*
    ... Delete all files from the following folders:
    Library/Preferences/Soundtrack/
    Library/Audio/Apple Loops Index/
    ... Now restart Soundtrack, and click "Setup...". All the indexed directories should be gone.
    ... You'll have to re-add and re-index your whole library. This may also affect GarageBand and/or Logic, and require re-indexing in them as well.
    *If you're still having trouble...* there may be some more index files floating around your system. Open Spotlight and set "System Files are Included" and "File Name" in the search options and search for "search index". This should show you where any remaining Apple Loop search index files are located, so you can delete them. They will be named stuff like "Search Index E44B5969-5E4A-4E27-A3C2-E5861C5D1FB8.txt".
    Hope this helps anyone else out there. It worked for me with Soundtrack 1.1 when my loops were all messed up.

    Well, to add metadata and transients to sound clips you need to edit them in Apple Loop Utility which is included with Final Cut Studio.
    To add custom loops to your permanent library you need to make a new folder like "My Loops" and put it somewhere permanent like in Library/Audio/Apple Loops and then index it with Soundtrack/GarageBand/Logic. Soundtrack uses the "Setup..." list and GarageBand you can just drag and drop into the loop browser. Not sure about Logic but it should be something similar.
    If you wanted to edit the index files manually from the Finder, they are in some weird format and I don't think it's possible.

  • Bitmap index or Composite index better on a huge table

    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.
    Regars,
    Madhu K.

    Dear,
    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.First of all, bitmap indexes are not recommended for write intensive OLTP applications due to the locking threat they can produce in such a kind of applications.
    You told us that this table is never updated; I suppose it is not deleted also.
    Second, bitmap indexes are suitable for columns having low cardinality. The question is how can we define "low cardinality", you said that you have 100,000 distincts group_no on a table of 100,000,000 rows.
    You have a cardinality of 100,000/100,000,000 =0,001. Group_no column might be a good candidate for a bitmap index.
    You said that order_no is unique so you have a very high cardinality on this column and it might not be a candidate for your bitmap index
    Third, your query where clause involves only the group_no column so why are you including both columns when testing the bitmap and the b-tree index?
    Are you designing such a kind of index in order to not visit the table? but in your case the table is made only of those two columns, so why not follow Hermant advise for an Index Organized Table?
    Finally, you can have more details about bitmap indexes in the following richard foot blog article
    http://richardfoote.wordpress.com/2008/02/01/bitmap-indexes-with-many-distinct-column-values-wotsuh-the-deal/
    Best Regards
    Mohamed Houri

  • "UPDATE GLOBAL INDEXES"를 사용하여, DDL 처리와 동시에 GLOBAL INDEX를 자동 관리하는 방안

    제품 : ORACLE SERVER
    작성날짜 :
    "UPDATE GLOBAL INDEXES"를 사용하여, DDL 처리와 동시에 GLOBAL INDEX를 자동 관리하는 방안
    ==========================================================================================
    PURPOSE
    이 문서에서는 다음과 같은 사항을 기술한다.
    1. 새로 추가된 기능으로, 테이블 파티션에 대한 DDL 수행시
    지정 가능한 "UPDATE GLOBAL INDEXES" 절에 대한 설명
    2. UPDATE GLOBAL INDEXES를 사용하는 것 보다는 REBUILD INDEX를
    사용하여야 하는 성능상의 고려사항.
    SCOPE
    Oracle Partitioning Option은 8~10g Standard Edition에서는 지원하지
    않는다.
    Explanation
    테스트를 위해 먼저 4개의 테이블을 생성한다.
    1. RANGE partitioned table을 생성한 후 GLOBAL index를 만든다:
    SQL> create table orders (
    2 order_no number,
    3 part_no varchar2(40),
    4 ord_date date
    5 )
    6 partition by range (ord_date)
    7 (partition Q1 values less than (TO_DATE('01-APR-1999','DD-MON-YYYY')),
    8 partition Q2 values less than (TO_DATE('01-JUL-1999','DD-MON-YYYY')),
    9 partition Q3 values less than (TO_DATE('01-OCT-1999','DD-MON-YYYY')),
    10 partition Q4 values less than (TO_DATE('03-JAN-2000','DD-MON-YYYY'))
    11 );
    Table created.
    SQL> create index orders_global_idx
    2 on orders(ord_date)
    3 global partition by range (ord_date)
    4 (partition GLOBAL1 values less than (TO_DATE('01-APR-1999','DD-MON-YYYY')
    5 partition GLOBAL2 values less than (TO_DATE('01-SEP-1999','DD-MON-YYYY')
    6 partition GLOBAL3 values less than (TO_DATE('01-DEC-2000','DD-MON-YYYY')
    7 partition GLOBAL4 values less than (MAXVALUE)
    8 );
    Index created.
    SQL> select substr(index_name,1,20) index_name,
    2 substr(partition_name,1,20) part_name,
    3 status
    4 from dba_ind_partitions
    5 where index_name= 'ORDERS_GLOBAL_IDX' order by partition_name;
    INDEX_NAME PART_NAME STATUS
    ORDERS_GLOBAL_IDX GLOBAL1 USABLE
    ORDERS_GLOBAL_IDX GLOBAL2 USABLE
    ORDERS_GLOBAL_IDX GLOBAL3 USABLE
    ORDERS_GLOBAL_IDX GLOBAL4 USABLE
    SQL> insert into orders values (1,100,TO_DATE('02-FEB-1999','DD-MON-YYYY'));
    2. HASH partitioned table을 생성 한 후 GLOBAL index를 만든다:
    SQL> CREATE TABLE emp_hpart(
    2 empno NUMBER(4) NOT NULL,
    3 ename VARCHAR2(10),
    4 sal NUMBER(7,2))
    5 PARTITION BY HASH(sal)
    6 (PARTITION H1, PARTITION H2, PARTITION H3, PARTITION H4);
    Table created.
    SQL> CREATE INDEX emp_global_HASH_idx ON emp_hpart(ename)
    2 GLOBAL PARTITION BY RANGE (ename)
    3 (PARTITION p1 VALUES LESS THAN ('N') ,
    4 PARTITION p2 VALUES LESS THAN (MAXVALUE));
    Index created.
    SQL> select substr(index_name,1,20) index_name,
    2 substr(partition_name,1,20) part_name,status
    3 from dba_ind_partitions
    4 where index_name= 'EMP_GLOBAL_HASH_IDX' order by partition_name;
    INDEX_NAME PART_NAME STATUS
    EMP_GLOBAL_HASH_IDX P1 USABLE
    EMP_GLOBAL_HASH_IDX P2 USABLE
    SQL> insert into emp_hpart values (1,'AAA',100);
    3. COMPOSITE partitioned table을 생성한 후 GLOBAL index를 만든다:
    SQL> CREATE TABLE emp_composite(
    2 empno NUMBER(4) NOT NULL,
    3 ename VARCHAR2(10),
    4 sal NUMBER(6))
    5 PARTITION BY RANGE(empno)
    6 SUBPARTITION BY HASH(sal) SUBPARTITIONS 4
    7 (PARTITION p1 VALUES LESS THAN (50),
    8 PARTITION p2 VALUES LESS THAN (100),
    9 PARTITION p3 VALUES LESS THAN (150),
    10 PARTITION p4 VALUES LESS THAN (MAXVALUE));
    Table created.
    SQL> CREATE INDEX emp_global_composite_idx ON emp_composite(ename)
    2 GLOBAL PARTITION BY RANGE (ename)
    3 (PARTITION p1 VALUES LESS THAN ('N') ,
    4 PARTITION p2 VALUES LESS THAN (MAXVALUE));
    Index created.
    SQL> select substr(index_name,1,20) index_name,
    2 substr(partition_name,1,20) part_name,status
    3 from dba_ind_partitions
    4 where index_name= 'EMP_GLOBAL_COMPOSITE_IDX' order by
    partition_name;
    INDEX_NAME PART_NAME STATUS
    EMP_GLOBAL_COMPOSITE P1 USABLE
    EMP_GLOBAL_COMPOSITE P2 USABLE
    SQL> insert into emp_composite values (1,'AAA',100);
    4. LIST partitioned table을 생성 한 후 GLOBAL index를 만든다:
    SQL> CREATE TABLE locations (
    2 location_id NUMBER, street_address VARCHAR2(80), postal_code
    CHAR(12),
    3 city VARCHAR2(80), state_province CHAR(2), country_id
    VARCHAR2(20))
    4 PARTITION BY LIST (state_province)
    5 (PARTITION region_east
    6 VALUES ('MA','NY','CT','NH','ME','MD','VA','PA','NJ'),
    7 PARTITION region_west
    8 VALUES ('CA','AZ','NM','OR','WA','UT','NV','CO'),
    9 PARTITION region_south
    10 VALUES ('TX','KY','TN','LA','MS','AR','AL','GA'),
    11 PARTITION region_central
    12 VALUES ('OH','ND','SD','MO','IL','MI',NULL,'IA'));
    Table created.
    SQL> create index loc_global_idx
    2 on locations (state_province)
    3 global partition by range (state_province)
    4 (partition p1 values less than ('NV'),
    5 partition p2 values less than (maxvalue));
    Index created.
    SQL> INSERT INTO locations VALUES
    2 ( 1000,'1297 Via Cola di Rie','00989','Roma',NULL,'IT');
    1 row created.
    SQL> select substr(index_name,1,20) index_name,
    substr(partition_name,1,20)
    2 part_name , status
    3 from dba_ind_partitions
    4 where index_name= 'LOC_GLOBAL_IDX' order by partition_name;
    INDEX_NAME PART_NAME STATUS
    LOC_GLOBAL_IDX P1 USABLE
    LOC_GLOBAL_IDX P2 USABLE
    *** 오라클 8/8i : UPDATE GLOBAL INDEXES 절을 사용하지 않았을 때
    SQL> select substr(index_name,1,20) index_name,
    2 substr(partition_name,1,20) part_name,status
    3 from dba_ind_partitions
    4 where index_name= 'ORDERS_GLOBAL_IDX' order by partition_name;
    INDEX_NAME PART_NAME STATUS
    ORDERS_GLOBAL_IDX GLOBAL1 USABLE
    ORDERS_GLOBAL_IDX GLOBAL2 USABLE
    ORDERS_GLOBAL_IDX GLOBAL3 USABLE
    ORDERS_GLOBAL_IDX GLOBAL4 USABLE
    SQL> ALTER TABLE orders DROP PARTITION q2;
    Table altered.
    SQL> select substr(index_name,1,20) index_name,
    substr(partition_name,1,20)
    2 part_name, status
    3 from dba_ind_partitions
    4 where index_name= 'ORDERS_GLOBAL_IDX' order by partition_name;
    INDEX_NAME PART_NAME STATUS
    ORDERS_GLOBAL_IDX GLOBAL1 UNUSABLE
    ORDERS_GLOBAL_IDX GLOBAL2 UNUSABLE
    ORDERS_GLOBAL_IDX GLOBAL3 UNUSABLE
    ORDERS_GLOBAL_IDX GLOBAL4 UNUSABLE
    => Oracle 9i 이전 버젼에서는, partitioned table의 특정 파티션에 대해
    DDL을 수행하면, 해당 파티션이 비어있는 상태가 아니라면,
    GLOBAL index에 대한 상태를 invalidate 시킨다.
    => Oracle 9i에서 UPDATE GLOBAL INDEXES 절을 수행하면, 테이블의
    파티션에 대한 DDL 작업을 수행하는 동안 GLOBAL INDEX에
    대한 관리 작업을 자동으로 수행하게 된다.
    그러나 일부 작업에 대해서는, 위와 같은 작업이 허용되지
    않는다.
    *** UPDATE GLOBAL INDEXES 절과 ADD PARTITION 절의 동시 사용
    1. RANGE partitioned table:
    SQL> ALTER TABLE orders ADD PARTITION q5
    2 values less than (TO_DATE('03-JUN-2000','DD-MON-YYYY'))
    3 UPDATE GLOBAL INDEXES;
    ALTER TABLE orders ADD PARTITION q5
    ERROR at line 1:
    ORA-30564: Index maintainence clause not allowed for ADD partition to
    RANGE
    partitioned tables
    UPDATE GLOBAL INDEXES 절은 다음 경우에만 사용할 수 있다.
    => HASH partitioned table에 partition 추가
    => Composite partitioned table에 subpartition 추가
    | RANGE partitioned table에 일반적인 방식으로 작업 수행 |
    SQL> ALTER TABLE orders ADD PARTITION q5
    2 values less than (TO_DATE('03-JUN-2000','DD-MON-YYYY'));
    Table altered.
    SQL> @sel
    INDEX_NAME PART_NAME STATUS
    ORDERS_GLOBAL_IDX GLOBAL1 USABLE
    ORDERS_GLOBAL_IDX GLOBAL2 USABLE
    ORDERS_GLOBAL_IDX GLOBAL3 USABLE
    ORDERS_GLOBAL_IDX GLOBAL4 USABLE
    2. HASH partitioned table:
    | UPDATE GLOBAL INDEXES절을 HASH partitioned table 에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_hpart ADD PARTITION q5
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    SQL> @sel
    INDEX_NAME PART_NAME STATUS
    EMP_GLOBAL_HASH_IDX P1 USABLE
    EMP_GLOBAL_HASH_IDX P2 USABLE
    3. COMPOSITE partitioned table:
    | UPDATE GLOBAL INDEXES 절을 COMPOSITE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_composite MODIFY PARTITION p1 add subpartition h5
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    SQL> @sel
    INDEX_NAME PART_NAME STATUS
    EMP_GLOBAL_COMPOSITE P1 USABLE
    EMP_GLOBAL_COMPOSITE P2 USABLE
    4. LIST partitioned table
    | LIST partitioned table에 대해서는 일반적인 방법 사용 |
    SQL> alter table locations ADD
    2 partition nomansland values ('XX');
    Table altered.
    SQL> @sel
    INDEX_NAME PART_NAME STATUS
    LOC_GLOBAL_IDX P1 USABLE
    LOC_GLOBAL_IDX P2 USABLE
    *** UPDATE GLOBAL INDEXES 절과 DROP PARTITION절의 동시사용
    1. RANGE partitioned table:
    | UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE orders DROP PARTITION q2 UPDATE GLOBAL INDEXES;
    Table altered.
    2. HASH partitioned table:
    HASH partitioned table에서는 DROP 명령을 수행할 수 없으며,
    COALESCE를 대신 사용함 (문서 마지막 부분을 참조)
    3. COMPOSITE partitioned table:
    | UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_composite DROP PARTITION p2
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    4. LIST partitioned table:
    | UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> alter table locations DROP PARTITION
    2 region_south
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    *** UPDATE GLOBAL INDEXES 절과 SPLIT PARTITION 절의 동시 사용
    1. RANGE partitioned table
    | UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE orders SPLIT PARTITION q3 AT
    2 (TO_DATE('15-SEP-1999','DD-MON-YYYY'))
    3 INTO (PARTITION q3_1, PARTITION q3_2)
    4 UPDATE GLOBAL INDEXES;
    Table altered.
    2. HASH partitioned table
    HASH partitioned table에서는 SPLIT 명령을 수행할 수 없으며,
    ADD를 대신 사용함 (윗 부분에 기술하였음)
    3. COMPOSITE partitioned table
    | UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_composite SPLIT PARTITION p2 AT (80)
    2 INTO (PARTITION p2_1, PARTITION p2_2)
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    4. LIST partitioned tables:
    | UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> alter table locations SPLIT PARTITION region_east
    2 VALUES ('MA','NJ')
    3 INTO (PARTITION region_east_1, PARTITION region_east_2)
    4 UPDATE GLOBAL INDEXES;
    Table altered.
    *** UPDATE GLOBAL INDEXES 절과 MERGE PARTITION 절의 동시 사용
    1. RANGE partitioned table
    | UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE orders MERGE PARTITIONS q2, q3 INTO PARTITION q3
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    2. HASH partitioned table
    HASH partitioned table에서는 MERGE 명령을 수행할 수 없으며,
    COALESCE를 대신 사용함 (문서 마지막 부분을 참조)
    3. COMPOSITE partitioned table
    | UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_composite MERGE PARTITIONS p1, p2
    2 INTO PARTITION p2
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    4. LIST partitioned table:
    | UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> alter table locations MERGE PARTITIONS region_east,region_west
    2 INTO PARTITION region_north
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    *** UPDATE GLOBAL INDEXES 절과 EXCHANGE PARTITION 절의 동시사용
    1. RANGE partitioned tables
    | UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE orders EXCHANGE PARTITION q3 WITH TABLE t_orders
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    If GLOBAL indexes exist on the TABLE of exchange, they are left UNUSABLE:
    SQL> create index t_orders_global_idx
    2 on t_orders(ord_date)
    3 global partition by range (ord_date)
    4 (partition GLOBAL1 values less than (TO_DATE('01-APR-1999','DD-MON-YYY
    Y')),
    5 partition GLOBAL2 values less than (TO_DATE('01-SEP-1999','DD-MON-YYY
    Y')),
    6 partition GLOBAL3 values less than (TO_DATE('01-DEC-1999','DD-MON-YYY
    Y')),
    7 partition GLOBAL4 values less than (MAXVALUE) );
    Index created.
    SQL> ALTER TABLE orders EXCHANGE PARTITION q3 WITH TABLE t_orders
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    SQL> @sel
    INDEX_NAME PART_NAME STATUS
    T_ORDERS_GLOBAL_IDX GLOBAL1 UNUSABLE
    T_ORDERS_GLOBAL_IDX GLOBAL2 UNUSABLE
    T_ORDERS_GLOBAL_IDX GLOBAL3 UNUSABLE
    T_ORDERS_GLOBAL_IDX GLOBAL4 UNUSABLE
    ORDERS_GLOBAL_IDX GLOBAL1 USABLE
    ORDERS_GLOBAL_IDX GLOBAL2 USABLE
    ORDERS_GLOBAL_IDX GLOBAL3 USABLE
    ORDERS_GLOBAL_IDX GLOBAL4 USABLE
    2. HASH partitioned tables
    | UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용하 |
    | 지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_hpart EXCHANGE PARTITION H1 WITH TABLE t_emp_hpart
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    3. COMPOSITE partitioned tables
    SQL> ALTER TABLE emp_composite EXCHANGE PARTITION p1 WITH TABLE t_emp_composi
    te;
    ALTER TABLE emp_composite EXCHANGE PARTITION p1 WITH TABLE t_emp_composite
    ERROR at line 1:
    ORA-14291: cannot EXCHANGE a composite partition with a non-partitioned table
    | UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_composite EXCHANGE SUBPARTITION SYS_SUBP286
    2 WITH TABLE t_emp_composite
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    4. LIST partitioned tables:
    | UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE locations EXCHANGE PARTITION region_east
    2 WITH TABLE t_locations
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    *** UPDATE GLOBAL INDEXES절과 MOVE PARTITION 절의 동시사용
    1. RANGE partitioned table
    | UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE orders MOVE PARTITION q3 TABLESPACE example
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    2. HASH partitioned table
    | UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_hpart MOVE PARTITION H1 TABLESPACE example
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    3. COMPOSITE partitioned table
    SQL> ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example;
    ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example
    ERROR at line 1:
    ORA-14257: cannot move partition other than a Range or Hash partition
    SQL> ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example
    2 UPDATE GLOBAL INDEXES;
    ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example
    ERROR at line 1:
    ORA-14257: cannot move partition other than a Range or Hash partition
    4. LIST partitioned table
    | UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE locations MOVE PARTITION region_east
    2 TABLESPACE TS_DATA1
    3 UPDATE GLOBAL INDEXES;
    Table altered.
    *** UPDATE GLOBAL INDEXES 절과 TRUNCATE PARTITION 절의 동시 사용
    1. RANGE partitioned tables
    | UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE orders TRUNCATE PARTITION q3
    2 UPDATE GLOBAL INDEXES;
    Table truncated.
    2. HASH partitioned tables
    | UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_hpart TRUNCATE PARTITION H1
    2 UPDATE GLOBAL INDEXES;
    Table truncated.
    3. COMPOSITE partitioned table
    | UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_composite TRUNCATE PARTITION p1
    2 UPDATE GLOBAL INDEXES;
    Table truncated.
    4. LIST partitioned table
    | UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
    | 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE locations TRUNCATE PARTITION region_east
    2 UPDATE GLOBAL INDEXES;
    Table truncated.
    *** UPDATE GLOBAL INDEXES 절과 COALESCE PARTITION 절의 동시사용
    1. RANGE partitioned table
    Range partitioned table에는 coalesce 기능이 지원되지 않음.
    2. HASH partitioned table
    | UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용 |
    | 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
    SQL> ALTER TABLE emp_hpart COALESCE PARTITION
    2 UPDATE GLOBAL INDEXES;
    Table altered.
    3. COMPOSITE partitioned table
    Composite partitioned table에 대해서는 coalesce 기능이 지원되지 않음.
    4. LIST partitioned table
    List partitioned table에 대해서는 coalesce 기능이 지원되지 않음.
    *** 성능상의 문제로 인해 UPDATE GLOBAL INDEXES 절을 사용하는 대신
    *** REBUILD INDEX를 사용하여야 할 경우
    UPDATE GLOBAL INDEXES절을 사용할 경우
    1 이전 버전에서는 단순히 invalid 상태로 표시하고 종료되었던 작업이
    인덱스 관리 작업까지 병행해 수행 되므로 partition DDL operation
    작업 수행 시간이 더 오래 걸린다.
    2 DROP, TRUNCATE, EXCHANGE 작업이 더 오래 걸린다. 이전에는 데이터
    딕셔너리상의 정보만을 갱신하는데 반해, UPDATE GLOBAL INDEXES절을
    사용할 경우, partition 내의 모든 row에 대한 scan 작업이 수행
    되기 때문이다.
    3 GLOBAL INDEX에 대한 갱신 작업을 통한 변경 사항이 redo log 및 rollback에
    남게 된다.
    4 row의 갯수가 작을 경우, update global index절을 사용하여 작업하는 것이
    편리하다.
    5 인덱스를 수동으로 rebuild 할 때 까지 애플리케이션 응답 속도가 현격
    하게 저하되는 것을 피할 수 있다.
    INDEX REBUILD를 사용할 경우
    1 전체 인덱스를 rebuild 하면, index가 좀더 효과적으로 구성된다.
    2 인덱스를 rebuild 하면, 사용자가 인덱스에 대한 구성을 수동으로
    변경할 수 있다.
    Example
    Reference Documents
    <Note:139707.1>

  • JTable SelectionModel - first Index and Las Index giving incorrect values

    Hi Guys,
    When i added a ListSelectionListener to the JTable's selectionModel, and tried to get the first index and last index values. The goofy thing i noticed is when you select different rows, the indexes are correct,but when you switch between the same rows, then indexes provided by the ListSelectionListener are always the same. Example : if you switch between 3 and 4 rows first index is 2 and last index is 3 which is correct, but if you go back 3rd row from 4th row, the first index is still 2 and last index is 3... which is kind of weird.
    Any ideas about this, and why this is happenning.
    I am pasting my sample code here any explanation is very helpfull to understand this behavior
    Thanks
    Nicedude
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JComponent;
    import javax.swing.ListSelectionModel;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    * SimpleTableSelectionDemo is just like SimpleTableDemo,
    * except that it detects selections, printing information
    * about the current selection to standard output.
    public class SimpleTableSelectionDemo extends JPanel {
         private boolean DEBUG = false;
         private boolean ALLOW_COLUMN_SELECTION = false;
         private boolean ALLOW_ROW_SELECTION = true;
         public SimpleTableSelectionDemo() {
              super(new GridLayout(1,0));
              final String[] columnNames = {"First Name",
                        "Last Name",
                        "Sport",
                        "# of Years",
              "Vegetarian"};
              final Object[][] data = {
                        {"Mary", "Campione",
                             "Snowboarding", new Integer(5), new Boolean(false)},
                             {"Alison", "Huml",
                                  "Rowing", new Integer(3), new Boolean(true)},
                                  {"Kathy", "Walrath",
                                       "Knitting", new Integer(2), new Boolean(false)},
                                       {"Sharon", "Zakhour",
                                            "Speed reading", new Integer(20), new Boolean(true)},
                                            {"Philip", "Milne",
                                                 "Pool", new Integer(10), new Boolean(false)}
              final JTable table = new JTable(data, columnNames);
              table.setPreferredScrollableViewportSize(new Dimension(500, 70));
              table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              if (ALLOW_ROW_SELECTION) { // true by default
                   ListSelectionModel rowSM = table.getSelectionModel();
                   rowSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             //Ignore extra messages.
                             if (e.getValueIsAdjusting()) return;
                             ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                             if (lsm.isSelectionEmpty()) {
                                  System.out.println("No rows are selected.");
                             } else {
                                  int selectedRow = lsm.getMinSelectionIndex();
                             System.out.println("Row " + selectedRow + " is now selected.");
                                  int first = e.getFirstIndex();
                                                            int last = e.getLastIndex();
                              System.out.println(" First Index is : " + first);
                              System.out.println(" Last Index is : " + last );
              } else {
                   table.setRowSelectionAllowed(false);
              if (ALLOW_COLUMN_SELECTION) { // false by default
                   if (ALLOW_ROW_SELECTION) {
                        //We allow both row and column selection, which
                        //implies that we *really* want to allow individual
                        //cell selection.
                        table.setCellSelectionEnabled(true);
                   table.setColumnSelectionAllowed(true);
                   ListSelectionModel colSM =
                        table.getColumnModel().getSelectionModel();
                   colSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             //Ignore extra messages.
                             if (e.getValueIsAdjusting()) return;
                             ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                             if (lsm.isSelectionEmpty()) {
                                  System.out.println("No columns are selected.");
                             } else {
                                  int selectedCol = lsm.getMinSelectionIndex();
                                  System.out.println("Column " + selectedCol
                                            + " is now selected.");
              if (DEBUG) {
                   table.addMouseListener(new MouseAdapter() {
                        public void mouseClicked(MouseEvent e) {
                             printDebugData(table);
              //Create the scroll pane and add the table to it.
              JScrollPane scrollPane = new JScrollPane(table);
              //Add the scroll pane to this panel.
              add(scrollPane);
         private void printDebugData(JTable table) {
              int numRows = table.getRowCount();
              int numCols = table.getColumnCount();
              javax.swing.table.TableModel model = table.getModel();
              System.out.println("Value of data: ");
              for (int i=0; i < numRows; i++) {
                   System.out.print("    row " + i + ":");
                   for (int j=0; j < numCols; j++) {
                        System.out.print("  " + model.getValueAt(i, j));
                   System.out.println();
              System.out.println("--------------------------");
          * Create the GUI and show it.  For thread safety,
          * this method should be invoked from the
          * event-dispatching thread.
         private static void createAndShowGUI() {
              //Make sure we have nice window decorations.
              JFrame.setDefaultLookAndFeelDecorated(true);
              //Create and set up the window.
              JFrame frame = new JFrame("SimpleTableSelectionDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //Create and set up the content pane.
              SimpleTableSelectionDemo newContentPane = new SimpleTableSelectionDemo();
              newContentPane.setOpaque(true); //content panes must be opaque
              frame.setContentPane(newContentPane);
              //Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              //Schedule a job for the event-dispatching thread:
              //creating and showing this application's GUI.
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
    }

    >
    I was (maybe wrongly) under the impression that, last index will give the last selected value and first index will give me the currect selected value. Not maybe - your impression sure is wrong. Honestly can't understand how it's possible to mis-interpret the api doc of ListSelectionEvent (except not reading it ;-)
    "Represents a change in selection status between firstIndex and
    lastIndex, inclusive. firstIndex is less than or equal to
    lastIndex. The selection of at least one index within the range will
    have changed."
    Jeanette

  • Allow indexing service to index this disk for fast file searching

    Hello,
    I'm using Oracle on Win 2000, I have lately found out that the option "Compress drive to save disk space"
    is not supported in Oracle.
    When I've opened the drive specifications on the properties dialog, I found also another option called "Allow indexing service to index this disk for fast file searching".
    My question are;
    1. Should I turn it off?
    2. Same question when the indexed directories does not include Oracle files?
    3. Same question, when the indexing service is set to off?
    Thanks,
    Tal Olier ([email protected])

    If this is a production machine, I'd definitely turn this off. Hopefully, no one is going to be searching for particular files on a production server-- they'll know where to go. You probably don't want any unnecessary background processes using up CPU or RAM either.
    If this is a development machine, the developer may be searching for files with some frequency. If that's the case, it may be worth it to keep this service enabled.
    I'm not aware of any Oracle issues when this service is running, but I'm paranoid enough not to trust it on a production box. If you're running on a dev box, you shouldn't have problems, particularly if you're not indexing Oracle files.
    Justin

  • Prefix Index and Substing Index not working

    Dear all,
    I'm trying to set the following preference to create my index:
    begin
    ctx_ddl.create_preference('substring_pref', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute('substring_pref','PREFIX_INDEX','TRUE');
    ctx_ddl.set_attribute('substring_pref','PREFIX_MIN_LENGTH',3);
    ctx_ddl.set_attribute('substring_pref','PREFIX_MAX_LENGTH',15);
    ctx_ddl.set_attribute('substring_pref','SUBSTRING_INDEX','TRUE');
    end;
    create index artikel_test_idx
    on artikel_test (art_content)
    indextype is ctxsys.context
    parameters ( 'WORDLIST substring_pref' )
    The index is created sucessfully.
    Here is the data I have in my table:
    ART_INHOUD ART_TITEL ART_CONTENT
    1 Titel1 prion alzheimer
    2 Titel2 prion word1 alzheimer
    3 Titel3 prion word2 word3 alzheimer
    4 Titel4 prion
    5 Titel5 alzheimer
    6 Titel6 alzheimer prion
    7 Titel7 alzheimer word1 prion
    8 Titel8 something else
    9 Titel9 prion alzheimer prion alzheimer
    10 Title10 i am theree
    11 Title11 contract initiation work
    12 Title12 oracle university else
    12 rows selected.
    I test the substring feature by searching for "alz". It should returns me all lines that contains "alzheimer". Am I right? But the result show nothing:
    select art_titel, score(1) as score
    from artikel_test
    where contains (art_content, 'alz', 1) > 0
    no rows selected
    If I search for the entire word, it works:
    select art_titel, score(1) as score
    from artikel_test
    where contains (art_content, 'alzheimer', 1) > 0;
    ART_TITEL SCORE
    Titel9 7
    Titel7 4
    Titel6 4
    Titel5 4
    Titel3 4
    Titel2 4
    Titel1 4
    7 rows selected.
    I look at the table DR$ARTIKEL_TEST_IDX$I and all works are in it:
    TOKEN_TEXT
    ALZ
    ALZH
    ALZHE
    ALZHEI
    ALZHEIM
    ALZHEIME
    ALZHEIMER
    ALZHEIMER
    AM
    CON
    CONT
    CONTR
    CONTRA
    CONTRAC
    CONTRACT
    CONTRACT
    Why there is no result when I search for 'alz'?
    Regards,
    Yanick
    Message was edited by:
    yankee75

    The prefix_index and substring_index do not make the substrings searchable as individual words. They just speed up wildcard queries. If you search for "alt" you will only get rows that have the word "alt" in it. If you search for "alt%" you will get all rows that contain words that begin with "alt". Here are some quotes from the Oracle Text Reference, which is part of the Oracle online documentation:
    "substring_index      Specify TRUE for Oracle Text to create a substring index. A substring index improves left-truncated and double-truncated wildcard queries such as %ing or %benz%. Default is FALSE."
    "prefix_index      Specify TRUE to enable prefix indexing. Prefix indexing improves performance for right truncated wildcard searches such as TO%. Defaults to FALSE."

Maybe you are looking for

  • Computer won't boot, all I get is a black screen

    I'm using Vista home premium and everything was working fine up until the other day. My computer froze up and I shut it down to restart. Upon restarting, I was given the option to start windows normally or in safe mode. I selected to start up windows

  • Acrobat X Pro suddenly no Adobe PDF printer available within applications

    I have been using X Pro for 2 months following installation of CS5.5 Premium. I used to be able to print-to-file using the Adobe PDF printer in the print dialog box from within apps such as Word and Finale. Suddenly that option is absent from my prin

  • Defective apple product

    Apple's MACbook apparently is not as durable as it is supposed to be. In 2 years time, hard drive changed twice, logic board once, touchpad once and another issue now still for our surprise. Definitely not the value of the product paid for. The patte

  • Reflection of extension reveals missing functionality.

    Hi. Using  C:\>c:\php5\php.exe -n -d extension_dir=c:\php5\ext -d extension="php_sqlsrv_53_nts_vc9.dll" --re sqlsrv Warning: Internal error: Cannot find extension function SQLSRV_PHPTYPE_STREAM in global function table in Unknown on line 0 Warning: I

  • IVew resizing with mouseover problem!!!

    Hi,       We have a portal Full Page IView that hosts a BW Web Application generated by the Web Application Designer. The Web Application fits exactly in the default content pane.       When someone does just a mouseover on the "Reduce/Enlarge Naviga