Import Table Statistics to another table

Hi,
Just like to know if I can use dbms_stats.import_table_stats to import table statistics to another table?
Scenario:
I exported the table statistics of the table (T1) using the command below.
exec dbms_stats.export_table_stats('<user>','T1',NULL,'<stat table>');
PL/SQL procedure successfully completed.
And then, I have another table named T2, T1 and T2 are identical tables. T2 does not have statistics (I intentionally did not run gather statistics). I am wondering
if I can import table statistics from T1 to T2 using dbms_stats package?.
For what I understand, statistics can be imported back at the same table which is T1 but not for another table using dbms_stat package. If I am wrong, anyone can correct me.
Thanks

hi
just try ;-) you lose nothing probably,
check afterwards last_analyzed value for that table in user_tables
if something is wrong, run regular stats

Similar Messages

  • Copy selected values from a table control into another table control

    hi there,
    as seen in the subject i need to copy selected values from a table control into another table control in the same screen. as i dont know much about table controls i made 2 table controls with the wizard and started to change the code... right now im totally messed up. nothing works anymore and i don't know where to start over.
    i looked up the forums and google, but there is nothing to help me with this problem (or i suck in searching the internet for solutions)
    i have 2 buttons. one to push the selected data from the top table control into the bottom tc and the other button is to push selected data from the bottom tc into the top tc. does somebody has a sample code to do this?

    you're funny
    i still don't get it... can't believe, there is no tutorial or sample code around how to copy multiple selected rows from a tc.
    here's my code, maybe you can tell me exactly were i have to change it:
    tc1 = upper table control
    tc2 = lower table control
    SCREEN 0100:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE get_nfo. --> gets data from the dictionary table
      MODULE tc1_change_tc_attr.
      LOOP AT   it_roles_tc1
           INTO wa_roles_tc1
           WITH CONTROL tc1
           CURSOR tc1-current_line.
      ENDLOOP.
      MODULE tc2_change_tc_attr.
      LOOP AT   it_roles_tc2
           INTO wa_roles_tc2l
           WITH CONTROL tc2
           CURSOR tc2-current_line.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP AT it_roles_tc1.
        CHAIN.
          FIELD wa_roles_tc1-agr_name.
          FIELD wa_roles_tc1-text.
        ENDCHAIN.
        FIELD wa_roles_tc1-mark
          MODULE tc1_mark ON REQUEST.
      ENDLOOP.
      LOOP AT it_roles_tc2.
        CHAIN.
          FIELD wa_roles_tc2-agr_name.
          FIELD wa_roles_tc2-text.
        ENDCHAIN.
        FIELD wa_roles_tc2-mark
          MODULE tc2_mark ON REQUEST.
      ENDLOOP.
      MODULE ok_code.
      MODULE user_command_0100.
    INCLUDE PAI:
    MODULE tc1_mark INPUT.
      IF tc1-line_sel_mode = 2
      AND wa_roles_tc1-mark = 'X'.
        LOOP AT it_roles_tc1 INTO g_tc1_wa2
          WHERE mark = 'X'.    -
    > big problem here is, that no entry has an 'X' there
          g_tc1_wa2-mark = ''.
          MODIFY it_roles_tc1
            FROM g_tc1_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc1
        FROM wa_roles_tc1
        INDEX tc1-current_line
        TRANSPORTING mark.
    ENDMODULE.                    "TC1_MARK INPUT
    MODULE tc2_mark INPUT.
      IF tc2-line_sel_mode = 2
      AND wa_roles_tc2-mark = 'X'.
        LOOP AT it_roles_tc2 INTO g_tc2_wa2
          WHERE mark = 'X'.             -
    > same here, it doesn't gets any data
          g_tc2_wa2-mark = ''.
          MODIFY it_roles_tc2
            FROM g_tc2_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc2
        FROM wa_roles_tc2
        INDEX tc2-current_line
        TRANSPORTING mark.
    ENDMODULE. 
    thx for anybody who can help with this!

  • A table cannot overlap another table

    Hi all,
    I have a pivot table pulling data from a range. When I try to insert table into the rage, I get the error message "A table cannot overlap another table"? I had initially inserted a table into the range and everything worked fine, but recently the
    TABLE TOOLS/DESIGN option in the ribbon bar don't show anymore!! so I figured to insert a table and that's when i got the above error message.
    When I try to refresh my pivot table I get this error message "We couldn't load the Data Model. This may be because the Data Model in this workbook is damaged".
    What's happening?

    Hi,
    Glad to hear you have solved it and thanks for sharing the experience here, it will definitely be hepful to others who meet the same problem.
    Regards,
    Melon Chen
    TechNet Community Support

  • How to update one table based on another table ??

    Hello Friends:
    I am trying to run the following query in oracle but it won't run.
    UPDATE BOYS
    SET
    BOYS.AGE = GIRLS.AGE
    FROM GIRLS
    WHERE
    BOYS.FIRSTNAME = GIRLS.FIRSTNAME AND
    BOYS.LASTNAME = GIRLS.LASTNAME;
    This query runs fine in sql server but in oracle its saying can't find "SET". PLease tell me what is the correct syntax in oracle to update one table based on another table.
    thanks

    See if this helps.
    If you wrote an SQL statement:
    update boys set age = 10;
    Every row in the boys table will get updated with an age of 10. But if you wrote:
    update boys set age = 10
    where firstname = 'Joe';
    Then only the rows where the firstname is Joe would be updated with an age of 10.
    Now replace the 10 in the above statements with (select g.age from girls g where g.firstname = b.firstname and g.lastname = b.lastname) and replace where firstname = 'Joe' in the second statement with where exists (select null from girls g where g.firstname = b.firstname and g.lastname = b.lastname). The same concepts apply whether 10 is an actual value or a query and whether you have a where clause with the update statement to limit rows being updated.
    About the select null question regarding the outer where clause:
    Since the query is checking to see if the row in the girls table exists in the boys table what the column is in this select statement doesn't matter, this column isn't being used anywhere. In this case Todd chose to use null. He could have also used a column name from the table or a lot of times you'll see the literal value 1 used here.

  • Best way to create a table based on another table

    Hello,
    I am trying to create a table based on another table with all the data in it. It has large data.
    create table <tablename> as select * from table1.
    Is this the best way of doing it or is there any other way. please advice.
    thanks

    I am suggested to create new table as
    create table <newtable> as
    select * from <oldtable> where rownum < 1;
    then
    alter table <newtable> compress;
    then
    insert /*+ append */ into <newtable> as select * from <oldtable>;
    but i getting an error saying missing values key words ora- 00926.
    please advice

  • Query to Identify Data in One Table Not In Another Table

    I need to create a query that will return the records in one table that are not in another table.  Here is the structure of my data tables:
    tbl_Practice – contains information about management practices.  The primary key field is “ID” which is an autonumber field.
    tbl_Controls – contains information about internal controls associated with the management practices.  The primary key is “ID” which is an autonumber.
    tbl_PracticeJoin – this is a table that contains the mapping of controls to practices.  Some practices can have multiple controls assigned to them and some controls can be mapped to multiple practices. 
    This table’s primary key is “ID” which is an autonumber field.  The only other data included in this table are the primary keys of the practice and control.  Those field names are “PracticeIDFK” and “ControlIDFK”.
    In this application, the user will normally enter practices and controls at the same time; however, there may be instances where a control is entered and it is not known at that time what practice(s) it should
    be mapped to.  I want to be able to run a query that will show me any controls that are in the tbl_Controls which are not in tbl_PracticeJoin.  I would like to be able to do the same with the practice table. 
    Thanks.

    The easiest way to do this is through the 'Find Unmatched Query Wizard'.
    On the Create tab of the ribbon, click Query Wizard.
    Select 'Find Unmatched Query Wizard'.
    Click OK.
    Select tbl_Controls, then click Next >.
    Select tbl_PracticeJoin, then click Next >.
    Select ID in tbl_Controls and ControlIDFK in tbl_PracticeJoin (if the wizard hasn't already done so automatically), then click Next >.
    Add the fields from tbl_Controls that you want to see to the list on the right; click >> if you want to add them all at once. Then click Next >.
    Access proposes a name for the query; you can edit the name if you wish.
    Click Finish.
    You can do the same for tbl_Practice and tbl_PracticeJoin, with PracticeIDFK instead of ControlIDFK.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Sorting not working if table linked to another table

    Got a table with student marks:
    Table 1 student
    mark
    A
    98
    B
    79
    C
    82
    if I copy/paste the marks to another table then sort (ascending, sort by B entire table), it is sorting as expected:
    Table 2 student
    Mark
    B
    79
    C
    82
    A
    98
    if instead I go in Table 2 and enter a formula in B2 to get the mark from table 1 (=Table1::B2), fill down the cells, Table 2 will not sort correctly and output this instead!!!!:
    Table 2 student
    Mark
    B
    98
    C
    79
    A
    82
    Yet another bug and it got submitted to Apple but if more users complain as well (using Provide Numbers Feedback), we might finally get Apple to release a bug-free version of Numbers that works as well as Excel for such basic tasks.

    squarebox is styled in three different places
    http://mljdesigns.com.au/Beaumaris%20North_2-2013/index-beaunps4.css line#513
    http://mljdesigns.com.au/Beaumaris%20North_2-2013/index-beaunps4.css line#623
    In the main document line#10
    I do noy know if this has anything to do with your problem as I cannot fault the position of the image.
    You may also want to have a look at line#104 of the main document where there is a stray ending division tag.

  • How to retrive one table records into another table by multiple records

    how to retrive table X records into another table Y by multiple records (means at once i want display 10 records) in form 6i .
    when i am written cursor it is ftching only one record.But i want to display all records at once.
    Declare
    Cursor cur_name is
    select PROTOCOL_NO,DOCNUM,SUBSETSN,REPEATSN,AESEQ,AETERM from coding_ae WHERE PROTOCOL_NO='KP229';
    Begin
    open cur_name;
    loop
    fetch cur_name into :PROTOCOL_NO,:DOCNUM,:SUBSETSN,:REPEATSN,:AESEQ,:AETERM;
    exit when cur_name%notfound;
    next_record;
    end loop;
    close cur_name;
    End;

    Hi,
    Make sure the cursor is in the detailed block. For that use 8GO_BLOCK* built-in. So the code will be
    Declare
    Cursor cur_name is
    select PROTOCOL_NO,DOCNUM,SUBSETSN,REPEATSN,AESEQ,AETERM from coding_ae;
    Begin
    GO_BLOCK('<detailed_block_name>');
    open cur_name;
    loop
    fetch cur_name into :PROTOCOL_NO,:DOCNUM,:SUBSETSN,:REPEATSN,:AESEQ,:AETERM;
    exit when cur_name%notfound;
    next_record;
    end loop;
    close cur_name;
    End;Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • How to insert a picture into a table extracting from another table in a for

    i have a form in which i have a image item though which i am saving a picture of datatype of long row or blob.This is working properly.
    But when i am saving this picture from screen into another table having same field name and same datatype,
    its not working.
    Can anybody find out it's solution
    om prakash sahoo
    ocac,bbsr

    find it under the java tutorial... should download n run it locally. its a good tutorial with all the stuff u need to know...

  • How to insert One table value to Another Table

    Hi friends
    Please have a look on this Code. Since i am new Java i am not able to findout the Solution for it
    private void displayavailablity(String selecteditem1)
                   try
                        Vector columnNames = new Vector();
                        Vector data1 = new Vector();
                        String bname,bauthor,bcategory,bref1,bavail,bid;
                        int bref,mid,num;
                        rs = st.executeQuery("SELECT * FROM Books where BAuthorandPublisher='" + selecteditem1 +"'");     
                        while(rs.next())
                             bname = rs.getString("BName");                         
                             bauthor = rs.getString("BAuthorandPublisher");
                             bcategory = rs.getString("BCat");
                             bref = rs.getInt("BRef");
                             if(bref==1)bref1="Yes";
                             else bref1 = "No";
                             mid = rs.getInt("Mid");
                             if(mid==0)bavail="Available";
                             else bavail="Issued To:"+mid;
                             bid = rs.getString("BId");
                             System.out.println("Book Name is::"+bname);
                             System.out.println("Book Availabilty::"+bavail);
                             num = st.executeUpdate("insert into BSearch Values('"+bid+"','"+bname+"','"+bcategory+"','"+bauthor+"','"+bavail+"','"+bref1+",')");
                             System.out.println("Inseted in the table");
                        /**ResultSetMetaData md= rs.getMetaData();
                        int columns =md.getColumnCount();
                        String booktblheading[]={"Book ID","Book NAME","BOOK AUTHOR/PUBLISHER","REFRENCE","CATEGORY"};
                        for(int i=1; i<= booktblheading.length;i++)
                             columnNames.addElement(booktblheading[i-1]);
                        while(rs.next())
                             Vector row = new Vector(columns);
                             for(int i=1;i<=columns;i++)
                                  row.addElement(rs.getObject(i));
                             data1.addElement(row);
                             //System.out.println("data is:"+data);
                        ((DefaultTableModel)table.getModel()).setDataVector(data1,columnNames);
                        //DefaultTableModel model = new DefaultTableModel(data1,columnNames);
                        //table.setModel(model);
                        rs.close();
                        //st.close(); */
                   catch(SQLException ex)
         }I trigger this Method when a JComboBox Item is Selected.
    For an example when i select an Item the select Query brings all the Record Equals to the Selected item. Now i want to insert the Selected items with some Modification to Another Table.
    Now the Problem is My Program Inserts Only One Record (Though there are Many Records Equals to Selected Item)
    Please give me a Better Solution
    Thank you

    jolif,
    If you're "new to java" then might I suggest you leave swing until you're "not so new to java"... it involves so many "advanced concepts" (unlike VB) that it constitutes a biohazard... i.e. it's fundamentally inimical to humanoid lifeforms.
    Now... Having duly vented my spleen, try rs.updateRow();

  • Data retrieve from one table control to another table control

    Hi all,
    I had an requirement like to create Two table controls.
    for first Table control i had an sel field defined as 'MARK'.
    when i check the row in the first table control think it  is header data for sales order .
    all the item details have to retrieve in the second table control.
    This is my requirement, i am not able to trigger when selecting the row in table control.
    will anybody had an experience like this.
    Regards,
    Madhavi

    Hi Madhavi,
    If  we need the case to display header and item as mentioned in 2 table controls....
    we can display in table control 2/item only (the line items of the one selected in the table control 1 or the header )...so ,at a time we need to display line items for only 1 header ....
    so ...first disable the selections/multiple selections to disable the row selector
    We have already declared a field type C to capture the value for the field selector...so we can convert this field to a radio button and then assign a function code to the radio button at screen level
    Whenever you click on the radio button ..immediately the function code is triggered..then in PAI ..we can check and find the header record with 'X' and populate the data for the table control 2
    Hope it helps
    Regards
    Byju

  • Is it possible to import existing tables dump into another tables.

    Hi,
    i have a schema called "xyz". in that i have a,b,c tables. i took a,b,c tables backup using normal export. and also i have e,f,g tables in same schema ("xyz"). i want to import a,b,c data into e,f,g tables. can anyone please let me know what is the import command. dont give me the data pump options. i have some problems to take the data pump expors of those 3 tables.

    841731 wrote:
    Hi,
    i have a schema called "xyz". in that i have a,b,c tables. i took a,b,c tables backup using normal export. and also i have e,f,g tables in same schema ("xyz"). i want to import a,b,c data into e,f,g tables. can anyone please let me know what is the import command. dont give me the data pump options. i have some problems to take the data pump expors of those 3 tables.not possible using exp & imp

  • How to use the Table Valueset in another Table Valuset

    Hi Friends ,
    I have one requirement let me explain you the scenario.
    in one segment of the Keyflex filed i need to get the all the grades of the business. which i did using the table valueset.
    now in another segment of the kff, i need to get all the grade steps depending on the selected grade.
    like if i have a grades say G1,G2,G3,G4...........
    and grade steps
    for G1-steps(1,2,3,4,5,6)
    for G2-steps(1,2,3,4)
    for G3-steps(1,2,3)
    for G4-(1,2,)
    etc.
    Now my requirement is if the user select the grade G1 from the valueset. then in the next filed of the segment should come only those steps which are valid for that grade.
    i hope i have given clear pic of my requirement can anyone please help me out, how to proceed for this.
    thanks in advance.

    Well, I know what you're talking about, but this is something that is usually done in different ways depending on the front end interface being used.
    Are you referring to Oracle Forms? Apex? .NET? Java? or what???
    This forum is for SQL and PL/SQL questions, so doesn't relate to a particular interface. SQL and PL/SQL do not have key flex fields, so, either ask your question in the correct sub-forum or give us more details as to your requirements.

  • How to call the Table Valueset in another Table Valueset

    Hi Friends ,
    I have one requirement let me explain you the scenario.
    in one segment of the Keyflex filed i need to get the all the grades of the business. which i did using the table valueset.
    now in another segment of the kff, i need to get all the grade steps depending on the selected grade.
    like if i have a grades say G1,G2,G3,G4...........
    and grade steps
    for G1-steps(1,2,3,4,5,6)
    for G2-steps(1,2,3,4)
    for G3-steps(1,2,3)
    for G4-(1,2,)
    etc.
    Now my requirement is if the user select the grade G1 from the valueset. then in the next filed of the segment should come only those steps which are valid for that grade.
    i hope i have given clear pic of my requirement can anyone please help me out, how to proceed for this.
    thanks in advance.

    Hi Manoj,
    Pls follow Metalink Note: How To Create Value Sets Where One Segment Is Dependent On The Previous Segment Selection? [ID 818624.1]
    Regards,
    Sujoy

  • Populate 1 table based on another table

    I have a "VISITOR_TRACKER" application with the following 2 tables:
    VISITORS (table)
    VISITOR_ID (pk)
    F_NAME
    L_NAME
    VISITOR_DETAILS (table)
    V_DETAILS_ID (pk)
    V_TIME_IN
    V_DESTINATION
    I want to do the following:
    1. The visitor types in his/her last name in a search box.
    2. Everyone with that last name shows up in either a report or a drop-down select list. The visitor selects his/her name.
    3. A form "displays only" the name selected and has 2 text fields for the customer to enter their DESTINATION and TIME_IN and presses the submit button.
    How do I set this up? The problem I'm encountering is that if I create a form w/report off of the VISITORS table, I'm unable to populate the DESTINATION and TIME-IN because the F_NAME and L_NAME from the VISITORS table is already popluted - it is trying to populate twice.
    I tried basing the form w/report off of the VISITOR_DETAILS table but my report shows only the names that have any records in VISITOR_DETAILS. Also, the form shows the details of the VISITOR_DETAILS record that was selected.
    My report query looks like this:
    select "VISITOR_DETAILS"."V_DETAILS_ID" as "V_DETAILS_ID",
    "VISITOR_DETAILS"."VISITOR_ID_LU" as "VISITOR_ID_LU",
    "VISITORS"."F_NAME" || ' ' || "VISITORS"."L_NAME" as "NAME"
    from "VISITOR_DETAILS" "VISITOR_DETAILS",
    "VISITORS" "VISITORS"
    where "VISITOR_ID_LU" = "VISITOR_ID"
    I prefer to have a drop-down select list instead of a report if possible.
    Please help! I have been working HOURS on this?

    if you only want a duplicat of the structure and don't worry about constraints, indexes, triggers etc you could use something like this
    create table emp_dup as
    select * from emp
    where 1=0;Another more flexible way is to use the package DBMS_METADATA
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_metada.htm#ARPLS026

Maybe you are looking for