Select rows from a partition

Hi All,
I have a table D_POSITION with partition created on record_date, key1 with Range-hash partition.
Previously I use to get the data by following this query.
SELECT * FROM D_POSITION PARTITION (P_20080331)
Recently I truncated the table and reinserted from the backup table.
Now this is giving me the 0 records. But for this partition we have more than 60000 records.
Please let me know where it went wrong....

SELECT * FROM D_POSITION PARTITION (P_20080331)[/i]
It's not advisable to use the partition clause in the query. You should use the predicate(where clause) that will make Oracle choose the appropriate partition.

Similar Messages

  • Selecting data from Multiple Partitions in a single select stmt.

    Hi all,
    My Database is very large & my tables are partitioned.
    My question is:
    1) If my data is spread across multiple partitions, is there any way to select data from multiple partitions in a single query?
    If we dont mention partition name also it works fine, but perofmance wise it will be very slow. (Using EXPLAIN PLAN)
    (Note:I dont want to make use of Union concept, i want to do it in a single select statement)
    For ex:
    qry1.sql:
    select empno from emp_trans partition (P012000)
    This above query(qry1.sql) will work fine.
    qry2.sql:
    select empno from emp_trans partition (P012000,P022000)
    The above query(qry2.sql) will return will return the following error:
    ORA-00933: SQL command not properly ended
    If anybody has any solution for this, pls mail me immediately.
    Thanks in advance
    bye
    null

    All my queries are dynamically generated. All my tables are also indexed partition wise based on date field. My question is, if i want to mention multiple partition names at the time of generating my query(select), then with parformance will be good. I have refered some books, inthat what they say is to use UNION concept, i dont want to use that, instead i want in a single select statement.
    Thaks for ur reply
    Bye
    null

  • Delete operation is not working to delete selected row from ADF table

    Hi All,
    We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
    <af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
    rows="#{bindings.EventCalendarVO.rangeSize}"
    emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
    fetchSize="#{bindings.EventCalendarVO.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
    >
    To perform delete operation i have one delete button.
    <af:commandToolbarButton
    text="Delete"
    disabled="#{!bindings.Delete.enabled}"
    id="ctb3" accessKey="d"
    actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
    As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
    public void deleteCurrentRow (ActionEvent actionEvent) *{*               DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    // Get an object representing the table and what may be selected within it
    ViewObject eventCalVO = dcItteratorBindings.getViewObject();
    // Remove selected row
    eventCalVO.removeCurrentRow();
    it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
    We have tried the below code as well in deleteCurrentRow() method
    RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    rowData.getRow().remove();
    The same behavior still.
    Thanks in advance.
    Rechin
    Edited by: 900997 on Mar 7, 2012 3:56 AM
    Edited by: 900997 on Mar 7, 2012 4:01 AM
    Edited by: 900997 on Mar 7, 2012 4:03 AM

    JDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
    as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
    Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
    This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
    Anyway you can try to remove the iterator row you get
    public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    dcItteratorBindings.removeCurrentRow();Timo

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • Parsing of select query "select col1 from temp PARTITION(P01)" is failing.

    Hi there,
    create table temp (col1 varchar(255)) parallel partition by hash(col1) (partition p01, partition p02 ,partition p03)
    "select col1 from temp PARTITION(P01)"
    The above select query is failing while parsing in antlr-2.7.5.jar.
    Caused by: com.database.sqlparser.InvalidSQLException:
         at com.database.sqlparser.SQLParserHelper.doParseSelectQuery(SQLParserHelper.java:95)
         at com.database.sqlparser.SQLParserHelper.parseSelectQuery(SQLParserHelper.java:26)
         at com.database.jdbc.JDBCQuery.executeQuery(JDBCQuery.java:40)
         at com.tasks.TempTask.call(TempTask.java:92)
         at com.tasks.TempTask.call(LDCProcessorThread.java:1)
         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         ... 1 more
    Caused by: line 1:70: unexpected token: (
         at com.database.sqlparser.ANSISQLParser.select_query(ANSISQLParser.java:277)
         at com.database.sqlparser.SQLParserHelper.doParseSelectQuery(SQLParserHelper.java:91)
         ... 9 more
    Thanks,
    Sid
    Edited by: user1945932 on Apr 5, 2010 7:33 AM

    It would appear that the java backtrace here came from either client or middle tier java rather than java running in the database server. If so, this isn't the appropriate forum for this question. The JVM forum is for questions related to the Oracle proprietary Java VM that runs in the database server. Unfortunately I can't suggest a more appropriate forum as I don't recognize the code that appears to be in use.

  • Getting the Selected Row from a JTable

    hi,
    how Can i get the Selected row from a JTable
    thanks...

    You know that JTable class? Well, you see those methods in it called "getSelectedRow()" and "getSelectedRows()"...?

  • How to select rows from database like 10 to 20 etc

    Hi Experts,
    I want to select rows from database like row number 10 to row number 20.How could it be done?

    HI,
       First get the data into the INTERNAL TABLE from the FLAT FILE and read the internal table using the index.
        ex: 1) Read table ITAB index 10.
              2) Read table ITAB index 20.
    or use as said by  Srinivas Gurram, to get the range of records using where condition to the loop.
    <REMOVED BY MODERATOR>
    Edited by: Ravi Kumar on Jun 9, 2008 4:01 PM
    Edited by: Alvaro Tejada Galindo on Jun 9, 2008 3:16 PM

  • How to get selected row from a non-bind ADF table

    Hi,
    I have an ADF table that is based on a collectionModel built programmatically. The collectionModel is this:
    model = new SortableModel(new ArrayList<ArrayList>());
    Hence, it is not a binding table. My question is how to get the selectedRows from a non-bind table.
    I am used to building binding ADF table and I know we can get it from voiterator.getCurrentRow, since the selectionListener is set to the binding....collectionModel.makeCurrent
    <af:table value="#{bindings.ItasLookupTypesVO1.collectionModel}"
    selectedRowKeys="#{bindings.ItasLookupTypesVO1.collectionModel.selectedRow}"
    selectionListener="#{bindings.ItasLookupTypesVO1.collectionModel.makeCurrent}"
    </af:table>
    I am thinking maybe I need to write my own selectionListener, but need more advice/ideas of what's the codes in the customer selection Listener to get it from my SortableModel.
    Please help.
    Thanks
    -Mina

    I'm not sure if this works in your case, but check out the selection listener I write in this blog http://wp.me/pcBZk-eu
    You should use the selection event and check the added set. This should give you access to the selected row.
    Timo

  • How to get selected row from table(FacesCtrlHierBinding ).

    I'am trying to get selected row data from table:
    FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
    Row rw = rowBinding.getRow();
    But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be found from my JDev 11.
    What is correct package for FacesCtrlHierBinding?

    Hi, another problem.
    I fill table with data manualy from source:
    <af:table var="row" value="#{getCompanyData.com}"
    rowSelection="single" columnSelection="single"
    editingMode="clickToEdit"
    binding="#{getCompanyData.tab}"
    selectionListener="#{getCompanyData.GetSelectedCompany}">
    <af:column sortable="false" headerText="col1">
    <af:outputText value="#{row.id}"/>
    </af:column>
    <af:column sortable="false" headerText="col2">
    <af:outputText value="#{row.name}"/>
    </af:column>
    <af:column sortable="false" headerText="col3">
    <af:outputText value="#{row.phone}"/>
    </af:column>
    </af:table>
    and when I'am trying to use method to get selected row:
    RichTable table = this.getTab(); //get table bound to UI Table
    RowKeySet rowKeys = table.getSelectedRowKeys();
    Iterator selection = table.getSelectedRowKeys().iterator();
    while (selection.hasNext())
    Object key = selection.next();
    table.setRowKey(key);
    Object selCompany = table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) selCompany;
    row = rowData.getRow();
    I got an error:
    SEVERE: Server Exception during PPR, #1
    javax.el.ELException: java.lang.ClassCastException: data.COMPANY cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    When I created tables by dragging data from date control, all worked fine.
    What could be a problem?

  • How do i copy and paste selected rows from numbers to another numbers worksheet

    I have asked this question before, but it sounds as if numbers did not have the update at that time.  I have pasted a spreadsheet from excel into numbers.  I would now like to take selected rows, for example, row 5, row 9, row 22, row 27, etc, copy these entire rows, and pastte into another blank numbers work sheet.  In excel, one can hold down the ctrl key, and click on each row they want to copy, and all will be copied in one operation,  Than you can paste into a new excel work sheet.  I have tried this on my ipad 2 many times, holding down the command key, and tapping on each row I want to copy.  I just cannot get this to work.  Please let me know how to do this, if numbers even has this possible.  Thanks.

    I have tried this on my ipad 2 many times, holding down the command key, and tapping on each row I want to copy.
    Command Key.... on ipad? Ddint know there was one.
    As for copying non-continuous ranges, cannot be done on ipad at this time. On a desktop maybe, but i cannot test it right now.
    Each row can be done individually, or you could sort the rows to grab the range you want. To do this (espeically if there is nothing that is unique about them), just make a new column and place a 1 in the cell for each row you want to copy, sort. That will place all your rows together and enable you to copy.paste them back out.
    If you want to preserve the original sort order, make another column (I usually use A for this) and put in =ROW() as the equation. Fill it down for the whole table and copy/paste values over it. now after you do any kind of sorting, you can always return the list to the original sort order.
    Jason

  • How do I select rows from the same table that have multiple occurances

    Hi Everybody,
    I am trying to select records from a detail table by grouping it. The table has more than 1 million records and the query is not performing well. The basic question is how to select a distinct record from a table which matches all values in one column and any in the other.
    desc SCV
    ID NUMBER PK (ID + SCRID)
    SCRID NUMBER FK(SC)
    ID SCRID
    1 1
    2 1
    3 1
    4 2
    5 2
    6 3
    7 4
    8 4
    desc PROJECTS
    ID NUMBER PK
    NAME VARCHAR2(100)
    ID NAME
    1 PROJECT1
    2 PROJECT2
    3 PROJECT3
    4 PROJECT4
    desc PJS
    ID NUMBER
    PROID NUMBER FK (PROJECTS)
    SCRID NUMBER FK (SCV(SCRID + SCVID)
    SCVID NUMBER
    ID PROID SCRID SCVID
    1 1 1 1
    2 1 1 2
    3 1 2 5
    4 1 3 6
    5 1 4 7
    6 2 1 3
    7 2 2 4
    8 2 2 5
    9 2 4 7
    There are over 1 million records in PJS.
    desc TBP
    SCRID NUMBER
    SCVID NUMBER
    SCRID SCVID
    1 1
    1 2
    1 3
    2 4
    2 5
    3 6
    4 7
    4 8
    The requirement is to select projects that have matching SCRID, SCVID from TBP such that
    all distinct SCRID should match and within that and any SCVID match will do. (A "AND" between each SCRID and an "OR" for each SCVID in that SCRID like 'SCRID = 1 AND (SCVID = 1 OR SCVID = 2 OR SCVID = 3) AND SCRID = 2 AND (SCVID =....)
    So, for the sample data it should return us PROID = 1
    I have few queries written for this:
    SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 1
    INTERSECT
    SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 2
    INTERSECT
    SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 3
    INTERSECT
    SELECT PROID FROM PJS,TBP WHERE TBP.SCVID = PJS.SCVID AND TBP.SCRID = 4
    This query performs well but the cost is very high, hardcoding, sorting.
    The 2nd option is to:
    SELECT pjs.PROID proid
    FROM TBP tbp,
    PJS pjs
    WHERE pjs.SCVID = tbp.SCVID
    AND pjs.SCRID = tbp.SCRID
    GROUP BY pjs.PROID
    HAVING COUNT(DISTINCT pjs.SCRID) = (SELECT COUNT(DISTINCT SCRID ) FROM TBP)
    This has a low cost but runs slowly.
    One more way I tried was with the IN operator like
    SELECT DISTINCT PROID FROM PJS A,TBP T WHERE T.SCRID = 1 AND T.SCVID = A.SCVID
    AND PROID IN (SELECT PROID FROM PJS A,TBP T WHERE T.SCRID = 2 AND T.SCVID = A.SCVID
    AND PROID IN (...SO ON with each DISTINCT SCRID.
    Again this involves too much of sorting.
    Any help will be appriciated.
    Thanks in advance.

    Hi Andrew,
    Use DELETE t_itab statement inside the loop.
    I have modified your code. It is perfectly working.See bellow  -
    LOOP AT it_zmember01 INTO wa_zmember01.
    WRITE: / wa_zmember01-mnumber UNDER 'NUMBER',
    wa_zmember01-mname UNDER 'NAME',
    wa_zmember01-mdob UNDER 'DOB'.
    WRITE / '-----------------------------------------------------------------'.
    DELETE it_zmember01.               " Modified
    ENDLOOP.
    DELETE it_zmember01. statement inside the loop will delete the current row of the table.
    Regards
    Pinaki

  • How to delete a selected row from datagrid and how to create a datagrid popup

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when  i selected a partiuclar row from a datagrid and click delete button  means that record will delete from the datagrid and DTO from the cloud  tables also.
                Ques 2: when i save  the data grid values using save button means that data will store in  respective cloud DTO which is related to the datagrid,
                     My requirement is i am using a search button when i click the search  button it will show a datagrid that datagrid will contain the previous  datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen:           i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen:                search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How to delete a Selected row from datagrid and how to create a datagrid popup with saved values

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
                Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
                    My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen: search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How to read 'clicked header' AND selected row from multicolumn listbox?

    I have a multicolumn listbox filled with 6 columns and about 500 rows.
    I want the user to be able to click on a column header, and sort the listbox alphabetically on that column. I've written the code for that, and that works. (using the 'itemnames' en 'get clicked col hdr' properties.)
    However, I also want to include the option, that when a user highlights a row, and then clicks on the header, that after the listbox gets sorted it scrolls down to the selected row.
    (So that the user doesn't have to search for it)
    And that's where things go wrong, because the value of the listbox changes to zero when you click on a column header. No I idea why it does that, but it's rather
    annoying. Can I change that behaviour somehow?
    Or any ideas how to get around it?

    My thanks to you and Jared.
    Seems I got a working solution now.
    Did take a while to figure out why your solution worked. Basicly, you're reading the row from a few iterations before.
    As soon as I understood that, I simplified it a little. Look at the attached file... I think it does the same. :-)
    Jared asked for the sorting routine. As I don't seem to be able to attach files when replying to comments, I took the liberty to include it here also.
    Basicly, I just use the 'sort 1D array' that comes with Labview 6. To be able to sort a 2D array, I convert every row to a cluster. That's something the 'sort 1D array' VI can handle nicely.
    To sort on the correct column, I just cut all columns in front, and paste them behind again. A
    fter sorting, I reverse the process.
    Anthony.
    Attachments:
    copy2_of_multicolumn.vi ‏26 KB
    sort_2d_string_array.vi ‏34 KB

Maybe you are looking for

  • SSIS-Execute Process task Error in 2012 version _File/Process "\\Servername\Foldername\batfile.bat" is not in path

    Hi Sir, I have develop the SSIS Package in 2012 version and i am calling the SSIS Package using Stored Procedure according to my requirement and that stored procedure will be using in my SSRS report Datasource. once after the SSIS Pacakge has design

  • How to embed a .swf file to my jsp page in eclipse

    I had a swf file which i want to include in my jsp page. To embed it i m using this code <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDT

  • Where Are TextEdit Documents Kept?

    I use Mavericks.  I just typed a letter within TextEdit, titled it, and now I can't find the letter.  Where should I be looking?

  • Using gnu's gcc instead of solaris cc

    To Anyone I would like to use gnu's development tools to compile the oracle demos since oracle's cc isn't installed and won't be installed anytime soon. How do i modify to demo_rdbms.mk to use the gnu tools? Archaned null

  • Adobe Updates for July

    Adobe Flash Player 18 has been updated to build 18.0.0.203 These updates address a critical vulnerability (CVE-2015-5119) that could allow an attacker to cause a crash and potentially allow an attacker to take control of the affected system. Download