How to return the entire row from a table

Hi guys,
Tabl A
FirstName varchar2(10),
Age Number,
Add varchar2(100),
Table B
Filedname varchar2(200), -- contains all the fields of table A
Datatype varchar2(100), -- Contains the datatypes of the filedname
Length Number -- contains the length of the fileds
Now how can i return the entire row from table A with the datatype and its length.
Any help would be appreciated ?
Here is the query I wrote but it how to take the datatype and its length..
create or replace procedure disp_table_data
as
type r_cursor is REF CURSOR;
c_A r_cursor;
er A%rowtype;
begin
open c_A for select * from A;
loop
fetch c_A into er;
exit when c_A%notfound;
dbms_output.put_line(er.FirstName||'--'||er.Age);
end loop;
close c_A;
END;
/

Guys,
I want column value from table A and its corresponding data_type and length from table B. I think I cant do it through joins.
Any idea would be appreciated ?.
Example ..
Tabl A
FirstName varchar2(10),
Age Number,
Add varchar2(100)
insert into A values('John',24,'Boston');
Table B
Filedname varchar2(200), -- contains all the fields of table A
Datatype varchar2(100), -- Contains the datatypes of the filedname
Length Number -- contains the length of the fileds
insert into B values('FirstName','varchar2',10); -- this is coming from table A.
Output should be like this...
John,Varchar2,10
Here (John is the FirstName - coming from table A, Varchar2 is a Datatype and 10 is the Length which are coming from table B ). Only column values are coming from table A , corresponding datatype and length are coming from B.
Any idea would be appreciated ?
Thanks.

Similar Messages

  • How to delete the committed row from a table from its VOImpl class ??

    I am new to ADF and I have problem to solve. To perform roll back I am using fetching key before roll back and setting it after undo operation, so that I can stay back in the currently selected row. But in my case I am using application model commit for one LOV attribute selection in the row. So when ever I am performing roll back operation after inserting a row, the values other than this committed LOV attribute gets roll backed, but I need remove the entire row from table. Does there any option to remove a row based on the attribute values of a row from VO's row implementation or from bean class in a performance optimized way ?
    Thanks in advance..........

    http://java.sun.com/javase/6/docs/api/javax/swing/table/DefaultTableModel.html#removeRow(int)
    Why did you mark it answered but gave no dukes to finalight? That's not how it works.
    You should mark his answer as correct and give him at least one duke, for the effort!

  • How to save the  selected rows from Advance table into database

    Hi
    I have requirement like..
    In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
    The reqt is how to save the selected multiple rows into the database.

    hi Reetesh,
    In Custom page
    Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
    So in Such scenario how to save this 10 rows against Recruiter
    , i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
    I hope u understand my question

  • How to move the selected rows from a  table control in dialog programming

    hiiiiiiii Every1
    I have to update some fields for a slected row in table control on click of a button and save it in database.
    Regards
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option, you can use same table or you can use differnt table by populating into that table and insert into the db table. If you want to use same internal table then use below code
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    insert into table from itab.
    ENDLOOP.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
    save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
    cols-screen-input = '0'.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
    MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
    save_ok = ok_code.
    CLEAR ok_code.
    CASE save_ok.
    WHEN 'TOGGLE'.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
    IF cols-screen-input = '0'.
    cols-screen-input = '1'.
    ELSEIF cols-screen-input = '1'.
    cols-screen-input = '0'.
    ENDIF.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    WHEN 'SORT_UP'.
    READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
    cols-selected = ' '.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDIF.
    WHEN 'SORT_DOWN'.
    READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
    cols-selected = ' '.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDIF.
    WHEN 'DELETE'.
    READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    DELETE itab.
    ENDLOOP.
    ENDIF.
    WHEN 'INSERT'.
    READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    itab1 = itab.
    modify itab1.
    ENDLOOP.
    ENDIF.
    if not itab1 is initial.
    INSERT dbtab FROM TABLE itab1.
    endif.
    ENDCASE.
    ENDMODULE.

  • Can i search a document for text in column a to return the entire row if column a matches in a separate sheet?

    Can i search multiple sheets in a document for text in column a to return the entire row if column a matches in a
    separate sheet?

    Thank you, Barry. That was helpful, and am hopeful that what I want to do is possible.
    I am creating a spreadsheet that currently has 20 sheets, of which certain sheets have more than one table.  I will be adding more sheets.  I would like to return results for all occurences of the search string.  Preferably into a seperate spreadsheet.  It would be perfect if that seperate sheet updated whenever I update information in the first spreadsheet.  To give an example:
    Sheet:     baskets
         Tables:         straw
                             wire
    Sheet:      barware
         Tables:          glasses
                              decanters
                              coasters
    My tables all have the same titiels:
    Vendor      Description     Cost     Selling Price
    Since I will have upwards of 100 sheets, with multiple tables, and most of my vendors will fit into multiple sheet categories, it would be helpful if I could also see what my order will be from each vendor, not just who I will be ordering each item from.  How would I do that? 
    I hope I conveyed that properly. 
    Thank you in advance for your help,
    Rana

  • Master Child tables how to get the latest rows from both

    Hi,
    Need some help with the sql. I have two tables Master & Child. In my Master table I have multiple rows for the same record and in the child table also multiple rows for the same master row how can I get the latest one's from both.
    For example Data in my Master table looks like
    CONT_ID                  SEQ_NUM        DESCRIPTION
    1                         189             Update 2
    1                         188             Update 1
    1                         187              NewNow in the child table for the same CONT_ID I may have the following rows
    CONT_ID                   UPDATED_DATE                                     STATUS
    1                        3/16/2010 2:19:01.552700 PM                          P
    1                        3/16/2010 12:29:01.552700 PM                         A
    1                        3/16/2010 12:29:01.552700 PM                         P
    1                        3/16/2010 12:19:01.552700 PM                         NIn my final query how can I get the row with seq_num 189 as it's the latest in Master table and from child table the row with status of P as it's the latest one based on the time. Here is the query i have but it returns the latest row from the child table only and basically repeats the master table rows as opposed to one row that is latest from both:
    Thanks

    Hi,
    You can use the analytic ROW_NUMKBER function to find the latest row for each cont_id in each table:
    WITH     got_m_rnum     AS
         SELECT     cont_id,     seq_num,     description
         ,     ROW_NUMBER () OVER ( PARTITION BY  cont_id
                                   ORDER BY          seq_num     DESC
                           ) AS m_rnum
         FROM    master_table
    --     WHERE     ...     -- any filtering goes here
    ,     got_c_rnum     AS
         SELECT     cont_id, updated_date,     status
         ,     ROW_NUMBER () OVER ( PARTITION BY  cont_id
                                   ORDER BY          updated_date     DESC
                           ) AS c_rnum
         FROM    child_table
    --     WHERE     ...     -- any filtering goes here
    SELECT     m.cont_id,     m.seq_num,     m.description
    ,     c.updated_date,     c.status
    FROM     got_m_rnum     m
    JOIN     got_c_rnum     c     ON     m.cont_id     = c.cont_id
                        AND     m.m_rnum     = c.c_rnum
                        AND     m.m_rnum     = 1
    ;If you'd like to post CREATE TABLE and INSERT statements for the sample data, then I could test this.
    If there happens to be a tie for the latest row (say, there are only two rows in the child_table with a certain cont_id, and both have exactly the same updated_date), then this query will arbitrarily choose one of them as the latest.

  • How can we pass the entire rows of a table to a web service in a VC model ?

    Hi,
    On the click of the submit button, I have to pass the rows of two tables into an enterprise service. This service also takes other fields of a form as an input.
    How can we pass the entire rows of a table into a service ?
    Regards,
    Nitin

    Hi Nitin,
    It seems that you have two or three different structures to pass data using your webservice. In your main question, two tables, you can join both in one table and from there call the webservice. In order to pass the entire table you need:
    1. Draw a line between your joinned table and your service,
    2. Map the fields,
    3. Create a 'SUBMIT' in your table tool bar. Right click on your table and choose 'Create Toobar', '+', name and choose 'Submit' as your event.
    4. Go to Configure Element (Table View) 'Multiple' at Selection Mode.
    Reward points if helps you to solve your question.
    Regards,
    Gilson Teixeira

  • How to delete the duplicate data  from PSA Table

    Dear All,
    How to delete the duplicate data  from PSA Table, I have the purchase cube and I am getting the data from Item data source.
    In PSA table, I found the some cancellation records for that particular records quantity  would be negative for the same record value would be positive.
    Due to this reason the quantity is updated to target but the values would summarized and got  the summarized value  of all normal and cancellation .
    Please let me know the solution how to delete the data while updating to the target.
    Thanks
    Regards,
    Sai

    Hi,
    in deleting the records in PSA table difficult and how many you will the delete.
    you can achieve the different ways.
    1. creating the DSO maintain the some key fields it will overwrite the based on key fields.
    2. you can write the ABAP logic deleting the duplicate records at info package level check with the your ABAPer.
    3.you can restrict the cancellation records at query level.
    Thanks,
    Phani.

  • How to deselect the Radio button from htmlb.table.TableView

    Hi Experts,
    Could you please help me, how to seselect the Radio button from htmlb.table.TableView?
    <hbj:tableView
                                       id="tbvCustomer"
                                       model="mcBean.csModel"
                                       design="ALTERNATING"
                                       headerVisible="TRUE"
                                       footerVisible="TRUE"
                                       navigationMode="BYPAGE"
                                       selectionMode="SINGLESELECT"                               
                                       fillUpEmptyRows="FALSE"
                                       headerText="Searchresults"
                                       visibleRowCount="10"
                                       onNavigate="CustomerSearchNavigate"
                                       visibleFirstRow="<%=mcBean.getCsVisibleFirstRow() %>">
    Problem: After searching and selecting the Customer in the table, then again we are searching for another customer. After that the searched customer is displaying in the Table. By default the table Radio button is selected. Because for first Customer we have selected the Radio button. How we can deselect the FRadio button while searching for another Customer.
    Thanks In Advance.
    Regards,
    Vijay.

    I think it is <2095>.
    In SmartForms, go to your text window. 
    Use the icon on the top left of the text window to switch to the old editor.
    INSERT -> CHARACTERS -> SAP ICONS. 
    Do a FIND on "radio".  It's called ICON_WD_RADIO_BUTTON_EMPTY.

  • How to handle the dynamic rows in pdf table

    Dear All,
    earlier i posted one thread reagarding getting pdf table data
    [facing problem while getting interactive form table data;
    this is working fine, i sued bind_table in wddoinit, but here i am fixing the rows count and bind_table.
    for example i have initially taken row count as 3 then i want to increase the rows in pdf table.
    i know we can use the formcalc to increase the rows by taking a button in pdf layout.
    this also working, but the data is not picking for newly added rows, i hope the problem is because the table node in the context is not binded for this new rows.
    even i tried using with webdynpro native button controlls still not working.
    any one help me what exactly this bind_table is doing and how to handle this code in form calc.
    since my table is pdf table.
    Thanks,
    Mahesh.Gattu

    Hi Thomas,
    Thanks for your confirmation,
    i have checked the paramets of submit button we have only wdevent parameters they are
    CL_WD_CUSTOM_EVENT
              PARAMETERS - Hashed table having 2 columns
              ID     ->IF_TDS (Interactive Form element Name)
             CONTEXT_ELEMENT     ->->
    these are same in case of submit button1 and submit button 2.
              NAME - Name of the Button Event i.e ON_SUBMIT (  this is also same in both the buttons).
    so i think it is not possible to work with multiple buttons by assinging to multiple tables on form.
    The other option is to place the buttons outside of the forum in the surrounding WDA area.
    This way you have no problem handling the events.
    in wddoinit if i use bind_table with 5 rows form table is populating with 5 rows, but when i take a button
    out side the form and use bind_table by incremeting the rows the pdf table rows are not adding, if i enter
    some thing on pdf table then click on add row button then the table rows are getting add. if i don't do any
    action on pdf table and click on add row button pdf is not getting update.
    is there any issue.. if i don't keep cursor on table and type some thing.. the add button is not updating
    the rows.
    if i take a  button on wd view i.e outside the form and use bind table i shall add the rows.. but in case of remove rows how to do.
    in case of normal table we can use Remove_Element( ) but how can i know the selected row from the pdf table, please help me in this concern also.
    Regards,
    Mahesh.Gattu
    Edited by: Maheshkumar gattu on Jan 7, 2009 3:57 PM
    Edited by: Maheshkumar gattu on Jan 7, 2009 4:03 PM
    Edited by: Maheshkumar gattu on Jan 7, 2009 5:21 PM

  • How to find the LOCKED ROWS in a table?

    Not locked objects, but for a table the locked rows.

    Check below links :
    http://www.jlcomp.demon.co.uk/faq/locked_rows.html
    How to find the locked row.
    who are waiting for same record?
    HTH
    Girish Sharma

  • How to return the correct row of data using diffferent conditions?

    I am having some problems with an sql query and I hope someone can help please?
    The data I am using is customers with multiple transactions. If a customer contains one transaction where the transaction type = 'W' then I need to set the output value to be transaction.ValueA. If the customer does not contain any transactions where the transaction type is 'W' then I need to set the output value to be
    the most recent transaction.ValueB where transaction.transaction_date <= customer.cust_mod_date.
    Here is an example of the data. For each test customer 10 and 20 I have put a star against the value I want to return
    CUSTOMER_ID CUST_MOD_DATE TX_DATE      TX_TYPE TX_VALUEA TX_VALUEB
    10          15/07/2009 16/07/2009     A     110      95
    10          15/07/2009 14/07/2009     A     100      90(*)          
    10          15/07/2009 13/07/2009     A     90          10
    10          15/07/2009 12/07/2009     A     80          5
    20          15/07/2009 15/07/2009     A     60          10
    20          15/07/2009 14/07/2009     W     50(*)     20
    20          15/07/2009 13/07/2009     A     40          30
    ie
    CREATE TABLE
    TMP_CUSTOMER (CUSTOMER_ID NUMBER, CUST_MOD_DATE DATE);
    insert into tmp_customer
    values(10, to_date('15/07/2009','dd/mm/yyyy'));
    insert into tmp_customer
    values(20, to_date('15/07/2009','dd/mm/yyyy'));
    CREATE TABLE
    TMP_TRANSACTION (TX_ID NUMBER, CUSTOMER_ID NUMBER, TX_DATE DATE, TX_TYPE VARCHAR2(1), TX_VALUEA NUMBER, TX_VALUEB NUMBER);
    INSERT INTO TMP_TRANSACTION
    VALUES (1,10, to_date('16/07/2009','dd/mm/yyyy'),'A',110,95);
    INSERT INTO TMP_TRANSACTION
    VALUES (2,10, to_date('14/07/2009','dd/mm/yyyy'),'A',100,90);
    INSERT INTO TMP_TRANSACTION
    VALUES (3,10, to_date('13/07/2009','dd/mm/yyyy'),'A',90,10);
    INSERT INTO TMP_TRANSACTION
    VALUES (4,10, to_date('12/07/2009','dd/mm/yyyy'),'A',80,5);
    INSERT INTO TMP_TRANSACTION
    VALUES (5,20, to_date('15/07/2009','dd/mm/yyyy'),'A',60,10);
    INSERT INTO TMP_TRANSACTION
    VALUES (6,20, to_date('14/07/2009','dd/mm/yyyy'),'W',50,20);
    INSERT INTO TMP_TRANSACTION
    VALUES (7,20, to_date('13/07/2009','dd/mm/yyyy'),'A',40,30);
    The query I have so far is
    (SELECT CUSTOMER_ID, CUST_MOD_DATE, TX_DATE, TYPE_FLAG, TX_VALUEA, TX_VALUEB, RN
    FROM (SELECT CUST.CUSTOMER_ID, CUST.CUST_MOD_DATE,TRANS.TX_DATE, TRANS.TYPE_FLAG, TRANS.TX_VALUEA,TRANS.TX_VALUEB,
    ROW_NUMBER() OVER (partition BY TRANS.CUSTOMER_ID ORDER BY TRANS.TX_DATE DESC) RN
    FROM TMP_CUSTOMER CUST,
    --- Return all transactions creating a type_flag field where Y = type W, else N ---
    SELECT CUST.CUSTOMER_ID, TX.TX_DATE, TX.TX_VALUEA, TX.TX_VALUEB, CUST.CUST_MOD_DATE, TX.TX_TYPE,
    CASE WHEN NVL(TX.TX_TYPE,'0') <> 'W' THEN 'N'
    WHEN NVL(TX.TX_TYPE,'0') = 'W' THEN 'Y'
    ELSE 'N'
    END AS TYPE_FLAG
    FROM TMP_TRANSACTION TX, TMP_CUSTOMER CUST
    WHERE TX.CUSTOMER_ID = CUST.CUSTOMER_ID
    AND CUST.CUSTOMER_ID in
    '10','20'
    ) TRANS
    WHERE CUST.CUSTOMER_ID = TRANS.CUSTOMER_ID
    --AND   TRANS.TX_DATE <= CUST.CUST_MOD_DATE
    AND CUST.CUSTOMER_ID in
    ('10','20'
    Can anyone please help with how I extract the record I am looking for
    ie customer 10 has amount 90
    customer 20 has amount 50.
    Thanks :-)
    GB

    SQL> select c_id
      2  ,      cust_mod_date
      3  ,      tx_date
      4  ,      tx_type
      5  ,      tx_valuea
      6  ,      tx_valueb
      7  from ( select c.customer_id c_id
      8         ,      c.cust_mod_date
      9         ,      t.tx_date
    10         ,      t.tx_type
    11         ,      t.tx_valuea
    12         ,      t.tx_valueb
    13         ,      row_number() over (partition by c.customer_id order by t.customer_id, t.tx_date desc) rn
    14         from   tmp_customer c
    15         ,      tmp_transaction t
    16         where  t.customer_id = c.customer_id     
    17         and    t.tx_date <= c.cust_mod_date
    18       )
    19  where case
    20          when tx_type = 'W' then 1
    21          when rn = 1
    22          and  not exists ( select null
    23                            from   tmp_transaction t2
    24                            where  t2.customer_id = c_id
    25                            and    t2.tx_type = 'W'
    26                          )
    27          then 1
    28        end = 1;
          C_ID CUST_MOD_ TX_DATE   T  TX_VALUEA  TX_VALUEB
            10 15-JUL-09 14-JUL-09 A        100         90
            20 15-JUL-09 14-JUL-09 W         50         20
    2 rows selected.

  • Retrieving the entire row from ResultSet

    Hi All,
    I am using SQL database and wants to get the data from tables as rows instead of columns. Please let me know if any of you know how to retrieve the rows from table using ResultSet.
    Thanks.

    you would need a loop like this:
    for( int i = 0; i < resultset.getMetadata().getColumnCount(); i++ )
      System.out.print( resultSet.getXXX( i ) );
    }That will print out the row

  • How to get the entire database from remote server to my server

    Hi,
    I am running a web application with sample data. Now i need to access the original data through this application. But the original data is located in the other server which is located in Mumbai.
    Now i need the copy of that database to my system(Chennai). with minimum effort.
    It is very urgent...
    Thanks in advance...
    Chaitanya.

    Hi
    Nicolas is right. You can also take advantage of exp/imp utility. That would not only get the entire db in one file but also the size will be a fraction of the entire db size.You can search for DataPump (that uses expdp and impdp) utility to expedite the export/import process.
    For simple exp/imp you can do the following.
    From Remote site(MUMBAI) issue
    ORACLE_HOME\BIN\exp file=c:\fulldbexp09sept05.dmp log=c:\fulldbexp09sept05log.log FULL=Y userid=system/pwd@connectstringOfyourdb
    Get a copy of fulldbexp09sept05.dmp and place it on your local drive in Chennai
    On Local Site (Chennai)
    ORACLE_HOME\BIN\imp file=fulldbexp09sept05.dmp log=fulldbimp09sept05 FULL=Y userid=system/pwd@connectstringOfyourlocaldb
    By this you can take advantage of having a different db name on remote and local sites. This is a fairly easy exercise. You just need to be sure that in your TNSNAMES.ORA you have correctly defined the connectString for your db.
    PS: Create a database on local server with default settings.
    Make use of following to create appropriate tablespaces and users if you desire ie.
    1. On Remote Site open SQLPLUS session and issue this command to find out the tablespaces, datafiles and their sizes
    SQL>SELECT SUBSTR(file_name,1,60) FILE_NAME, tablespace_name, bytes
    FROM dba_data_files
    GROUP BY tablespace_name, file_name;
    Now create the tablespaces on local sites using the result of the above query.
    2. On Remote Site open SQLPLUS session and issue this command to spool user creation script.
    SQL>spool c:\createuserscript.lst
    SQL> SELECT 'CREATE USER ||' IDENTIFIED BY VALUES '||'"'||PASSWORD||'"'||' DEFAULT TABLESPACE '||DEFAULT_TABLESPACE||' TEMPORARY TABLESPACE '||TEMPORARY_TABLESPACE||';'
    FROM dba_users
    WHERE username NOT IN ('SYS','SYSTEM')
    ORDER BY username;
    SQL>spool off
    Now edit this createuserscript using any editor and replace " with '. Copy this file to the local server and run it using @. This will create appropriate users.
    Let me know if you have any problems.
    Regards
    Adnan Mashhadi
    Nicolas I am not sure as how to eliminate the " in my script. Any comment will be appreciated.

  • Can one retrieve only the Nth row from a table?

    Hi,
    Can anyone explain the execution order of the below query to fetch the nth row data.
    SELECT * FROM t1 a
    WHERE n = (SELECT COUNT(rowid)
    FROM t1 b
    WHERE a.rowid >= b.rowid);
    Thanks,
    Satya.

    >
    If you're interested in a more efficient way to get the Nth row of the table, in order by ROWID:
    >
    Perhaps you should change that to 'tremendously more efficient'?
    Ran some tests of the two using a table that contained 50+ thousand records created from ALL_OBJECTS
    CREATE TABLE EMP_ALL_OBJECTS AS SELECT * FROM ALL_OBJECTSThen ran your query (modified for the new table) for r_num = 10000. It returned immediately and used 925 consistent gets.
    Ran the original query (modified for the new table) for '10000 = '. It took 3 minutes and used 24189252 consistent gets.
    Thought maybe it was a fluke so ran the orginal query for '1 = '. It took the same 3 minutes and used 24189253 consistent gets.
    Maybe someone else could try to reproduce these results?
    Here is the plan for Frank's query
    >
    Execution Plan
    Plan hash value: 3171438729
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cos
    t (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 47057 | 7858K| | 19
    93 (1)| 00:00:24 |
    |* 1 | VIEW | | 47057 | 7858K| | 19
    93 (1)| 00:00:24 |
    |* 2 | WINDOW SORT PUSHED RANK| | 47057 | 7812K| 9664K| 19
    93 (1)| 00:00:24 |
    | 3 | TABLE ACCESS FULL | ALL_OBJECTS_EMP | 47057 | 7812K| | 2
    39 (1)| 00:00:03 |
    Predicate Information (identified by operation id):
    1 - filter("R_NUM"=10000)
    2 - filter(ROW_NUMBER() OVER ( ORDER BY ROWID)<=10000)
    Note
    - dynamic sampling used for this statement (level=2)
    Statistics
    0 recursive calls
    0 db block gets
    866 consistent gets
    0 physical reads
    0 redo size
    1281 bytes sent via SQL*Net to client
    407 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    >
    And the plan for the original query
    >
    Execution Plan
    Plan hash value: 308981268
    | Id | Operation | Name | Rows | Bytes | Cost (
    %CPU)| Time |
    | 0 | SELECT STATEMENT | | 471 | 80070 | 10M
    (1)| 35:14:03 |
    |* 1 | FILTER | | | |
    | |
    | 2 | TABLE ACCESS FULL | ALL_OBJECTS_EMP | 47057 | 7812K| 239
    (1)| 00:00:03 |
    | 3 | SORT AGGREGATE | | 1 | 12 |
    | |
    |* 4 | TABLE ACCESS BY ROWID RANGE| ALL_OBJECTS_EMP | 2353 | 28236 | 238
    (0)| 00:00:03 |
    Predicate Information (identified by operation id):
    1 - filter( (SELECT COUNT(ROWID) FROM "ALL_OBJECTS_EMP" "B" WHERE "B".ROWID<=
    :B1)=1)
    4 - access("B".ROWID<=:B1)
    Note
    - dynamic sampling used for this statement (level=2)
    Statistics
    7 recursive calls
    0 db block gets
    24189253 consistent gets
    0 physical reads
    0 redo size
    1218 bytes sent via SQL*Net to client
    408 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    >
    Looks like the original query is doing a probe of the entire 2nd table for each row of the 1st table - almost a CARTESIAN result. It takes the same time no matter which record you are looking for.

Maybe you are looking for

  • Unable to expand volume on array

    I've got a Mac Pro (Early 2008, 8x2.8Ghz, 6GB memory) with a Highpoint RocketRaid 3522 card in it. I started out with a raid 5 array of 3 1TB WD GreenPower drives in a SuperMicro CSE-M35T-1B sata cage. Partitioned it as GUID HFS+ (1.8TB) and it works

  • Link to bookmark in .docx

    Hi, was just wondered if it is possible to link to a bookmark in a microsoft word document? I figured it would work similar to how you'd link to a bookmark in a HTML file but to no avail. heres my code so far: btn1.addEventListener(MouseEvent.CLICK,

  • Photo Booth Audio and Video are out of sync?

    Hi. So there is this glitch that when I take videos on Photo Booth the audio and video are out of sync. This started after I upgraded to Mountain Lion, and since I use Photo Booth a lot, I really do care. Is there anyway that I can fix this until App

  • How to clone the hardware driver?

    Is it possible to clone the hardware driver files from one (installed) linux distribution to another?

  • This song could could be used because the original file could not be found

    Why does iTunes do this to a lot of music that I have purchased and songs that I have downloaded from my personal cd's? I have moved since purchasing some songs and when that happened I could no longer play them. Please help. Nicukr