To select records

Hi
I am having 1000 records.May i know how to query to get the records from 200 to 250.
Thank you
Mary

Rowid will not help you regarding the order in which the information in your table was populated.
Rowid shows you the physical location on the disk where the information is situated; still if you reorganize the information, or import some other information, export so on.. the ROWID will change!!
So rowid is not the solution.
When you want to get the chronological order of your information, then:
1. Be sure that you have a sequence (which is inserted in the table with a trigger, before insert);
2. Or use the timestamp so that you can see when the information was inserted.
Then you can sort and get the Nth row etc.
Hope it helps,
Michael.

Similar Messages

  • Is there any provision to view the selected record using SYS_REFCURSOR?

    hi friends ,
    I was using SQL Server . now i am shifting to Oracle . so we are changing the Stored Procedures in SQLServer to Oracle SP's. I have given the structure of procedure given below . If possible , i want to see the output of select statement in the TOAD editor . If any body knows please help me
    CREATE OR REPLACE PROCEDURE PS_AON
    P_STATUS OUT VARCHAR2,
    P_CUR OUT SYS_REFCURSOR
    AS
    BEGIN
    OPEN P_CUR FOR
              select colum1,column2,column3 from Table 1;
    EXCEPTION
                   WHEN OTHERS THEN
                   P_STATUS:=SQLERRM;
    END;
    This is one of the model of stored procedures i am using . And the editor i am using is TOAD 7.3.0 and oracle 9i. Is there any provision to view the selected records by running this procedure in TOAD editor
    thanks & regards

    (assuming you have relatively recent version of TOAD).
    Write a small block to call the procedure (or use Toad's 'execute procedure' option) as in the example below. Note the ':' in front of 'v_cur_out'. When you run the block, TOAD will prompt you for a value / datatype for 'v_cur_out'. Ignore the value, set the datatype to 'Cursor' and click OK. The resultset (if any) will be displayed in the Data Grid window below.
    DECLARE
       v_status VARCHAR2 (32767);
    BEGIN
       ps_aon (v_status, :v_cur_out);
       DBMS_OUTPUT.PUT_LINE ('v_status => ' || v_status);
    END;
    /

  • How to get selected record details when single selection is used in a table

    Hi All,
    Inside a query region I have created a table using region wizard,for this table I have added a singleSelection Item. What I want is , on selection of a particular record i want to update or view that record in a new page , for this I have added update and view icons in each row.
    But I am unable to get the particular selected record
    OATableBean tableBean = (OATableBean)webBean.findChildRecursive("ResultTableRN");
    OASingleSelectionBean singleSelection = (OASingleSelectionBean)tableBean.getTableSelection();
    For this singleSelection object I was unable to find any method which will give the value of the view attribute associated with it.
    Anybody any suggestions regarding it ?
    Thanks in advance,
    Anant NImbalkar.

    Hi Anant,
    here is how you have to do it
    1) you need to enable PPR on that Singl selection , by changining the Action type =fireAction.
    2) define the envent , EVENT
    3) define paramters for that event. This is place that gives you handle to the Attribute of VO.
    So you can define paremters such
    Name = PARAM1
    value =${oa.EqxContactPrivEOVO1.ContactPrivilegeId}
    You can define as many paramters as you can for the vo field that u wanted to have.
    Now in the procesformRequest() , all you do it handle the event EVENT and get the parameters
    if ("EVENT".equals(pageContext.getParameter(EVENT_PARAM)))
    String accountid= pageContext.getParameter("PARAM1");
    You can refer developer guide for further details.

  • WHERE ... IN ... SELECT records for a given list of PKs (or FKs)

    Hello folks,
    Many times we need to retrieve records for given lists of PKs (or FKs), as:
    p_pk_list := '11,22,33';
    We work in 10g
    A co-worker of mine had a good idea (I thought) to "help" the optimizer and build a recordset in the FROM clause and use it later in WHERE
    SELECT ...
    FROM tableName a,
    (SELECT REGEXP_SUBSTR(p_pk_list, '[^,]+',1,ROWNUM) p_pk_id
    FROM dual
    CONNECT BY ROWNUM <= LENGTH(p_pk_list ) - LENGTH(REPLACE(p_pk_list ,','))) d_pk
    WHERE
    a.ID=d_pk.p_pk_id; -- (1)
    The tragedy is that it takes 4 seconds to retrieve 5 records from the table (no other joins). The table has about 40 columns though and there are about 51000 records. With the SELECT REGEXP_SUBSTR in the WHERE clause, it's a bit worse.
    If (1) is replaced by:
    a.ID IN (11,22,33,44,55);
    the execution takes 0.04 seconds.
    My questions are:
    1. Is this a bad idea to select records for a given list of PKs or FKs? Should one just go for one PK/FK instead?
    2. Why the stiff performance penalty?
    3. Ideally, it would be nice if this would work:
    a.ID IN (p_array);
    where p_array would be an array of integers
    Any elegant sollutions?
    Thanks a lot.
    Dan

    Check the explain plan for both statements.
    I would wager that the overhead you experience is due to the fact that you are comparing apples to oranges here.
    (SELECT REGEXP_SUBSTR(p_pk_list, '[^,]+',1,ROWNUM) p_pk_id
    FROM dual
    CONNECT BY ROWNUM <= LENGTH(p_pk_list ) - LENGTH(REPLACE(p_pk_list ,','))) d_pkreturns a string.
    a.ID IN (11,22,33,44,55);Is a list of numbers.
    If you check the explain plan for the regexp version, you should see an implicit conversion being done for you (converting the number column into a string for comparison) which means you can't use any indexes defined on a.id.
    If you want to use an array of numbers here's an approach using a built in array of numbers.
    declare
       v_number_list  sys.odcinumberlist   default sys.odcinumberlist();
    begin
       v_number_list.extend;
       v_number_list(v_number_list.count) := 100;
       v_number_list.extend;
       v_number_list(v_number_list.count) := 200;
       for vals in
          select *
          from all_objects
          where object_id in
             select column_value
             from table(cast(v_number_list as sys.odcinumberlist))
       loop
          dbms_output.put_line(vals.object_name);
       end loop;
    end;
    25  /
    I_TYPED_VIEW1
    I_NTAB2
    PL/SQL procedure successfully completed.
    ME_XE?Otherwise do an explicit TO_NUMBER on the regexp query so that you can use any indexes defined on the table in question.

  • How to select records in ALV using FM

    Hi guys,
    How to select records in ALV using FM. Not the OO method. Thx in advance!
    Kun

    hI
    by using REUSE_ALV_FIELDCATALOUG_MERGE. Iys fill field catalouge table as per internal table description. Then use REUSE_ALV_GRID_DISPLAY for display ALV REPORT.
    **Please reward suitable points***
    With Regards
    Navin Khedikar

  • How to edit the selected record through a popup page

    Hi, can anyone help me to handle the case ?
    1) In main page, there is a datatable showing the record list. Click a commandLink in the selected record to popup a screen for user edit.
    2) The data is validated and then saved into database after clicking the submit button in the popup.
    3) Finally, the main page is refreshed with the latest record list.
    Thanks

    Just like any other servlet or form-processing script. What would a mere HTML page know about "systems"? Put the URL into the form destination attribute and be done.

  • Performance problem with selecting records from BSEG and KONV

    Hi,
    I am having performance problem while  selecting records from BSEG and KONV table. As these two tables have large amount of data , they are taking lot of time . Can anyone help me in improving the performance . Thanks in advance .
    Regards,
    Prashant

    Hi,
    Some steps to improve performance
    SOME STEPS USED TO IMPROVE UR PERFORMANCE:
    1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
    2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
    3. Design your Query to Use as much index fields as possible from left to right in your WHERE statement
    4. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
    5. Avoid using nested SELECT statement SELECT within LOOPs.
    6. Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.
    7. Avoid using SELECT * and Select only the required fields from the table.
    8. Avoid nested loops when working with large internal tables.
    9. Use assign instead of into in LOOPs for table types with large work areas
    10. When in doubt call transaction SE30 and use the examples and check your code
    11. Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.
    12. Use "CHECK" instead of IF/ENDIF whenever possible.
    13. Use "CASE" instead of IF/ENDIF whenever possible.
    14. Use "MOVE" with individual variable/field moves instead of "MOVE-
    CORRESPONDING" creates more coding but is more effcient.

  • JSF - Problem in Retrieving selected record from datatable

    I am new to JSF and in the process of developing a new web application using JSF.
    I have problem in retrieving the selected record from a datatable. I am using h:datatable tag and h:commandlink in a column for selecting a particular row on the datatable.
    I have populated the data to the datatable by binding a bean and its property.
    When I retrieve also I am binding to a bean in the action attribute of the h:commandlink tag in h:column of that datatable.But when I try to bind the bindign attribute of the h:datatable tag to the datatable instance in my Bean , my JSF File gets corrupted..
    How to implement this without any issue??plz help me regarding this.

    HI
    Try the below code
    DATA lo_nd_del TYPE REF TO if_wd_context_node.
    DATA lo_el_del TYPE REF TO if_wd_context_element.
    DATA ls_del TYPE wd_this->Element_del.
    DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.
    DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.
    DATA ls_et_postab_1 TYPE wd_this->Element_del.
    DATA lt_et_postab_1 TYPE wd_this->Elements_del.
    DATA: wa_temp TYPE REF TO if_wd_context_element,
    lt_temp TYPE wdr_context_element_set.
    * navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection
    lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).
    CALL METHOD lo_nd_et_postab_1->get_selected_elements
    RECEIVING
    set = lt_temp.
    * navigate from <CONTEXT> to <DEL> via lead selection
    lo_nd_et_postab_1 = wd_context->get_child_node( name = wd_this->wdctx_del ).
    LOOP AT lt_temp INTO wa_temp.
    CALL METHOD wa_temp->get_static_attributes
    IMPORTING
    static_attributes = ls_et_postab_1.
    ls_et_postab_1-vbeln = del. // adding new attribute value.
    APPEND ls_et_postab_1 TO lt_et_postab_1.
    CLEAR ls_et_postab_1.
    ENDLOOP.
    lo_nd_et_postab_1->bind_table( new_items = lt_et_postab_1 ).

  • Can we enable "Select record Set Message choice" of Table in left side

    Hi ,
    I have requirement to set the "Select Record Set " Message choice of a table region on left side.
    Ex:If there are more records in a table region and message choice available to select next set of records.
    You can chk in Workflow Status Monitor function.
    Its the Navigation Bar to be @ left side on the table Region whcih allows you to navigate the records set.
    Thanks,Sarath.
    Edited by: SarathL on Dec 13, 2011 4:59 PM

    Hi,
    Not sure what exactly you are looking for.
    The Next link and option to select next set of rows comes to your OA Table by default .. isn't it?
    -Idris

  • Selecting records from DEFAULT range-list subpartition

    Is it possible to select records which belong to DEFAULT subpartition of a certain partition of a RANGE-LIST partitioned table, using subpartition pruning? Our task assumes creating partitions and subpartitions in a table dynamically before running ETL. But sometimes due to complexity of the path subpartition key goes from staging data to materialized views in data warehouse, we cannot predict all subpartition key values upfront. We can create DEFAULT subpartition for every partition though, and have Oracle place records which don't match any subpartition condition into that subpartition.
    But later we need to split DEFAULT subpartition so that all records will go into their dedicated subpartitions, and DEFAULT will be left empty - other layers of our application need all records to be stored in subpartition other than DEFAULT in order to be available. For that, we need to know which keys are stored in DEFAULT subpartition. And the question is - how can we effectively achieve that?
    The obvious "brute force" approach is to issue a query like:
    select distinct subpart_key from mytable partition (myrangepartition) where not subpart_key in (list of all subpartition key values for this partition)
    but it does not use partition pruning - I have checked execution plan. While it is possible to use only DEFAULT partition, this query will iterate through all subpartitions, which is huge performance impact. How can we instruct Oracle to use only DEFAULT subpartition?

    is the solution. I have overlooked this syntax - now my life is much easier.

  • Selecting records based on formula fields

    Post Author: Mike Kennedy
    CA Forum: Formula
    I have created a field (called "Shortage") that is the result of subtracting two running totals and have inserted all three fields into the group footer.  I only want to select those records that have a negative value as a result, but the field is not shown in the Select Expert.  None of my formula fields show up in the Select Expert for some reason (normally they do).  Does anyone know why and how can I select these records only?  Thanks.

    Post Author: SKodidine
    CA Forum: Formula
    Running Totals are only available once the records are being read and processed.  You are calculating the difference between two Running Totals and then want to use that to select records?  I don't think that is possible.  One way of accomplishing the display of groups which have a negative value is to use sum functions instead of the running totals and then in group selection criteria, display only those groups which have a negative value as a result of subtracting the two sums.

  • Selecting records based on different fields

    Post Author: timg
    CA Forum: General
    I have three groups which I study quite often, the blues (as identified in field 1with codes), the reds (identified in field 2 with codes), and the greens (identified in field 3 with certain codes).
    I want to be able to run one report which, through a parameter field, I can select the group (red, green, or blue) for which I can select records from the database and analyze. Stated another way, if I select "Blue" in the parameter field, how can I get CR to pull certain records in the correct field with the correct codes.

    Post Author: yangster
    CA Forum: General
    dunno what your codes are but something like this will work if you put it in the section expertif ?para = "BLUE" then field1 in &#91;a, b, c&#93; elseif ?para = "RED" then field2 in &#91;d, e, f&#93; elseif ?para = "GREEN" then field3 in &#91;g, h, i&#93; 

  • Select Recording Source issue on Audigy 2

    I unistalled and installed the program and can't get it to work. I have the Audigy 2 ZS plat. with the software and all. Problem I have when I open up the Organizer MediaSource Player everything works but the "select recording source" button or selection doesn't work. It's kind of blanked out as if I don't have that option at all. But when I go to the mixer I can here the line inputs but I can't record from it b/c I can't select it. If anyone has this issues let me know or how to solve it. I have windows XP and also my Audio Stream recorder doesn't work either.

    Ok I got it to work. This is the reply I got from Creative but I didn't remove the program from the add/remove option on the PC b/c that didn't work at first. I inserted the installation CD and remove it from that wizard. Rebooted and the PC found new hardware. I then installed the driver and software from the CD and now it works.
    For Mediasource. It appears something was corrupted in Mediasource or there is a conflict within the system.Please uninstall all software and drivers for the soundcard, from add/remove programs. Once this is done, shut down the system and changePCI slots for the soundcard, then turn the system back on, cancel the found new hardware wizard, disable all background applications (especially virus scanner, firewall, and any other background applications running in the bottom right hand corner of the system), andthen perform a full reinstallation of the drivers and software from the soundcard installation cd.
    CAT I hope you fix your sound card. Good luck.

  • Select records based on first n distinct values of column

    I need to write a query in plsql to select records for first 3 distinct values of a single column (below example, ID )and all the rows for next 3 distinct values of the column and so on till the end of count of distinct values of a column.
    eg:
    ID name age
    1 abc 10
    1 def 20
    2 ghi 10
    2 jkl 20
    2 mno 60
    3 pqr 10
    4 rst 10
    4 tuv 10
    5 vwx 10
    6 xyz 10
    6 hij 10
    7 lmn 10
    so on... (till some count)
    Result should be
    Query 1 should result --->
    ID name age
    1 abc 10
    1 def 20
    2 ghi 10
    2 jkl 20
    2 mno 60
    3 pqr 10
    query 2 should result -->
    4 rst 10
    4 tuv 10
    5 vwx 10
    6 xyz 10
    6 hij 10
    query 3 should result -->
    7 lmn 10
    9 .. ..
    so on..
    How to write a query for this inside a loop.

    Hi,
    So, one group will consist of the lowest id value, the 2nd lowest and the 3rd lowest, reggardless of how many rows are involved. The next group will consist of the 4th lowest id, the 5th lowest and the 6th lowest. To do that, you need to assign numbers 1, 2, 3, 4, 5, 6, ... to the rows in order by id, with all rows having the same id getting the same number, and without skipping any numbers.
    That sounds like a job for the analytic DENSE_RANK function:
    WITH     got_grp_id     AS
         SELECT     id, name, age
         ,     CEIL ( DENSE_RANK () OVER (ORDER BY id)
                   / 3
                   )          AS grp_id
         FROM     table_x
    SELECT     id, name, age
    FROM     got_grp_id
    WHERE     id     = 1     -- or whatever number you want
    ;If you'd care to post CREATE TABLE and INSERT statements for your sample data, then I could test it.
    See the forum FAQ {message:id=9360002}

  • Select records based on criteria and update those records once read

    hi,
    I am very new to bpel and DB adapters.
    I have a requirement where in I need to query two tables to fetch some records and update these selected records with a new value for field to indicate that bpel has processed these records.
    Once I select these I needs the output to be mapped to the output variable.
    I am able to select the records based on criteria , but how will i lock these records so that these records do not get processed again. This should be a very simple usecase just that I am not aware.
    Thanks,
    Robin

    Once you have finished reading the records fire an update query , update some field in the table so that it does not get picked up next time.
    if you are using polling for picking up the records, then use logical delete scenario, refer....http://docs.oracle.com/cd/E15523_01/integration.1111/e10231/adptr_db.htm#BABEEBIH

  • Select records based on monthly anniversary date

    Hi,
    I have a table with a date_added field and I want to select records based on the monthly anniversary date of this field.
    eg. ID, Date_added
    1, 10-DEC-2012
    2, 11-NOV-2012
    3, 10-MAR-2012
    4, 28-FEB-2012
    5, 30-DEC-2012
    So For the 10th of Jan 2013, I would want to return records 1 and 3 only
    I started looking at the extract function, but this soon falls down for records at the end of the month. For example, on the 28th Feb, I would also want to include records where the date_added day is the 29th, 30th or 31st. So, in the table above I would want to return records 4 and 5, but extract would only return 4.
    Is there a simple function to do this month anniversary query - am I missing something very obvious? Or, do I need to write a query to explicitly cope with dates at the end of the month? So far I haven't found a sensible simple solution!
    I'm using 11g
    thanks

    I didn't look into leap year, but this should give you a starting point:
    select  *
      from  t
      where 1 = case last_day(to_date(:target_date,'mmddyyyy'))
                  when to_date(:target_date,'mmddyyyy')
                    then case
                           when to_char(date_added,'dd') >= to_char(to_date(:target_date,'mmddyyyy'),'dd')
                             then 1
                         end
                  else case
                           when to_char(date_added,'dd') = to_char(to_date(:target_date,'mmddyyyy'),'dd')
                             then 1
                         end
                end
    /For example, target date is 1/10/2013:
    SQL> variable target_date varchar2(8)
    SQL> exec :target_date := '01102013';
    PL/SQL procedure successfully completed.
    SQL> with t as (
      2             select 1 id,to_date('10-DEC-2012','dd-mon-yyyy') date_added from dual union all
      3             select 2,to_date('11-NOV-2012','dd-mon-yyyy') from dual union all
      4             select 3,to_date('10-MAR-2012','dd-mon-yyyy') from dual union all
      5             select 4,to_date('28-FEB-2012','dd-mon-yyyy') from dual union all
      6             select 5,to_date('30-DEC-2012','dd-mon-yyyy') from dual
      7            )
      8  select  *
      9    from  t
    10    where 1 = case last_day(to_date(:target_date,'mmddyyyy'))
    11                when to_date(:target_date,'mmddyyyy')
    12                  then case
    13                         when to_char(date_added,'dd') >= to_char(to_date(:target_date,'mmddyyyy'),'dd')
    14                           then 1
    15                       end
    16                else case
    17                         when to_char(date_added,'dd') = to_char(to_date(:target_date,'mmddyyyy'),'dd')
    18                           then 1
    19                       end
    20              end
    21  /
            ID DATE_ADDE
             1 10-DEC-12
             3 10-MAR-12
    SQL> And target date is 2/28/2013:
    SQL> exec :target_date := '02282013';
    PL/SQL procedure successfully completed.
    SQL> with t as (
      2             select 1 id,to_date('10-DEC-2012','dd-mon-yyyy') date_added from dual union all
      3             select 2,to_date('11-NOV-2012','dd-mon-yyyy') from dual union all
      4             select 3,to_date('10-MAR-2012','dd-mon-yyyy') from dual union all
      5             select 4,to_date('28-FEB-2012','dd-mon-yyyy') from dual union all
      6             select 5,to_date('30-DEC-2012','dd-mon-yyyy') from dual
      7            )
      8  select  *
      9    from  t
    10    where 1 = case last_day(to_date(:target_date,'mmddyyyy'))
    11                when to_date(:target_date,'mmddyyyy')
    12                  then case
    13                         when to_char(date_added,'dd') >= to_char(to_date(:target_date,'mmddyyyy'),'dd')
    14                           then 1
    15                       end
    16                else case
    17                         when to_char(date_added,'dd') = to_char(to_date(:target_date,'mmddyyyy'),'dd')
    18                           then 1
    19                       end
    20              end
    21  /
            ID DATE_ADDE
             4 28-FEB-12
             5 30-DEC-12
    SQL> SY.

Maybe you are looking for

  • How to upload a file in application server to an internal table

    Hi,       I am asked to upload a file from application server to internal table. Can you please suggest me the ways to do it or the function module which helps to browse the application server file names.   I have done a program. But its giving probl

  • FCE rendering with Western Edition MyBook External Hard Drive

    So i am having some difficulty with this project i am working on (i am learning as i go) and was wondering if anyone can shed some light... Ok, so i am using final cut express to edit video footage. I uploaded about 2 1/2 hours worth of HD footage in

  • Install Lync Web App Plugin For Another User

    I'm wondering if there is a way to install the plugin for the Lync Web App for another user. The reason why is that administrative permissions are required and our users are not allowed to have those permissions. I have the MSI but when I look at it,

  • Confirm TO 1, 2 or 3 times

    Hi, I want to post the GR and to put the material away in several storage type for exemple from 902>922>117-->976. The TO has been created in background. I confirm the TO through storage unit. My question: It is possible to confirm the TO more than o

  • Have you tried your iPhoto 5 DVD backups with iPhoto 6?

    Hi, Have you tried your iPhoto 5 DVD backups with iPhoto 6? When I upgraded to iPhoto 5 I had to rebuild all my previous iPhoto 4 backups to the new version. It took hours and I had to re-burn the DVDs in the new format. Thanks, -meny