Not able to copy all the record from the table?

Hi All,
I have a table Table_1 with 5 crores of data. I have created the same table structure Table_2 like Table_1 and trying to insert the entire data from Table_1 to Table_2 by use of the below code:
CREATE OR REPLACE PROCEDURE insert_prc (limit_in IN PLS_INTEGER)
IS
    cursor cur_insert
    IS
    SELECT  *
    FROM    Table_1;
    type tabtype_insert IS TABLE OF cur_insert%ROWTYPE INDEX BY PLS_INTEGER;
    v_tabtype_insert   tabtype_insert;
    v_limit_rows    NUMBER := 1000;
    v_start    PLS_INTEGER;
    v_end      PLS_INTEGER;
    v_update_count  NUMBER;
    v_bulk_errors   NUMBER;   
begin
    DBMS_SESSION.free_unused_user_memory;
    show_pga_memory (limit_in || ' - BEFORE');
    v_start := DBMS_UTILITY.get_cpu_time;
    BEGIN
        open cur_insert;
        LOOP
            FETCH cur_insert BULK COLLECT INTO v_tabtype_insert LIMIT v_limit_rows;
            FORALL i IN 1..v_tabtype_insert.COUNT SAVE EXCEPTIONS
            INSERT INTO  Table_2
            VALUES v_tabtype_insert(i);
            EXIT WHEN v_tabtype_insert.COUNT < v_limit_rows;
            COMMIT;
        END LOOP;
        CLOSE cur_insert;
    EXCEPTION
    WHEN OTHERS
    THEN
        v_update_count := 0;
        v_bulk_errors := SQL%BULK_EXCEPTIONS.COUNT;
        dbms_output.put_line('Number of INSERT statements that failed : ' ||v_bulk_errors);
        dbms_output.put_line('*******************************************************************************************************************');
        /*FOR i IN 1..v_bulk_errors
        LOOP
            dbms_output.put_line('An Error ' || i || ' was occured '|| SQL%BULK_EXCEPTIONS(i).ERROR_INDEX ||
                                ' during update of Actuator Model: '|| v_tabtype_mtl_items(SQL%BULK_EXCEPTIONS(i).ERROR_INDEX) ||
                                ' . Oracle error : '|| SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
        END LOOP;   */
        dbms_output.put_line('*******************************************************************************************************************');
    END; 
      v_end := DBMS_UTILITY.get_cpu_time;
      DBMS_OUTPUT.put_line (   'Elapsed CPU time for limit of '
                            || limit_in
                            || ' = '
                            || TO_CHAR (v_end - v_start)/100
      show_pga_memory (limit_in || ' - AFTER');
end insert_prc;
CREATE OR REPLACE PROCEDURE APPS.show_pga_memory (
   context_in   IN   VARCHAR2 DEFAULT NULL
SELECT privileges required on:
   SYS.v_$session
   SYS.v_$sesstat
   SYS.v_$statname
Here are the statements you should run:
GRANT SELECT ON SYS.v_$session TO schema;
GRANT SELECT ON SYS.v_$sesstat TO schema;
GRANT SELECT ON SYS.v_$statname TO schema;
IS
   l_memory   NUMBER;
BEGIN
   SELECT st.VALUE
     INTO l_memory
     FROM SYS.v_$session se, SYS.v_$sesstat st, SYS.v_$statname nm
    WHERE se.audsid = USERENV ('SESSIONID')
      AND st.statistic# = nm.statistic#
      AND se.SID = st.SID
      AND nm.NAME = 'session pga memory';
   dbms_output.put_line(CASE
                               WHEN context_in IS NULL
                                  THEN NULL
                               ELSE context_in || ' - '
                            END
                         || 'PGA memory used in session = '
                         || TO_CHAR (l_memory)
END show_pga_memory;
/From the above procedure i am able to insert only some 5000000 data. Remaining 4 crores data is not inserted. But the program says it is completed sucessfully.
Note: Table_2 is the partitioned table and Table_1 is non partitioned table.
Can anyone please what is the problem on above code?
Thanks

user212310 wrote:
-- Using BULK COLLECTS and FORALL's will consume more resources.Ya i will agree that. That's what i am using LIMIT clause passing value as 1000. It means PL/SQL will reuse the same 1000 elements in the collection each time the data is fetched and thus also reuse the same memory. Even if my table grows in size, the PGA consumption will remain stable.Limit or not, your process will consume more resources (and take longer) than the one i showed you. AND it's many many many more lines of code (harder to maintain, etc...).
user212310 wrote:
-- If you don't have a reason (aside from misguided understandings as to which is more performant) to use BULK COLLECTS and FORALL's then you should go with the direct INSERT INTO SELECT * method.The reason i am using BULK COLLECT is to reduce the execution time of the procedure.
Please let me know if i misunderstood something.
ThanksYes, you have.
Please read this
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:760210800346068768

Similar Messages

  • I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items to those devices but it won't work. I also have tried copying and pasting those files onto those devices but that doesn't work too. Can any one help?

    I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items I want to copy to those devices but it won't work. I also have tried copying and pasting those files onto those devices too but that doesn't work too. Can any one help?

    Hi BobRz
    Thanks for you suggestion but it didn't work - are there other ways for solving this problem? Or is it because my files that I want to copy and paste onto my hard disk etc are too big? (However there is space on my hard disk and it works on a PC)

  • I used to be able to copy and paste images from the internet into keynote slides and pages. Now when I copy and paste all I get is an empty  box. My iskysoft iTube studio has also stopped downloading videos. Is there an extension I need to enable?

    I used to be able to copy and paste images from the internet into keynote slides and pages. Now when I copy and paste all I get is an empty  box. My iskysoft iTube studio has also stopped downloading videos. Is there an extension I need to enable? Any ideas

    Try dragging the image to the desktop, then drag the image to the slide you want it on

  • Google maps 3.2.1 error, and not able to copy all ...

    Hi,
         Although the google maps version 3.2.1 is working fine in my nokia 808 Belle FP2 but the problem is whenever i am trying to zoom in it is showing "google maps error couldn't write record store:1/0 error"
        And 2nd thing i am not able to copy synchronised messages back from nokia pc suite to my nokia 808. Some messages are getting copied randomly and others are not. When i have tried to select all And drag and drop, some got copied and some not. And when i tried to do it individually, again some got copied and the others which did not got copied; showed that messages has been copied successfully but actually it didn't got copied.
    Can anyone please provide me with a fix to the above 2 problems?
    Thanking you,
    P.Bhowmik

    santathe1 wrote:
    @aspergerguy, can you please confirm that Google Maps 4.01(1) is working for you?
    This version only worked post Belle FP2 upon my 700 and as 701 only sold for limited markets there do seem some inconsistencies as to what works compared with 700. Here is screenshot taken just now:
    Happy to have helped forum with a Support Ratio = 42.5

  • I was able to copy all my files from my Time Capsule, but that is all they are...files. How do I get my new Mac Mini to emulate my other Mac?

    I was able to copy all my files from my Time Capsule, but that is all they are...files. How do I get my new Mac Mini to emulate my other Mac?

    Doggiemommie,
    Copying files is not a good idea.
    The "other Mac" was backed up onto Time Capsule using the Time Machine. On your new Mac you should restore the old user - rather than copy files manually.
    This usually happens during the initial setup of the new computer or you can do it later using Migration Assistant.
    Please note, it is possible to damage backup file on the Time Capsule when you browse it and copy files manually.
    Hope this explains.
    TZ

  • Why I am not able to copy and paste photos from my desktop to my Itouch?

    I am not able to copy and paste photos from my computer to my Itouch. I use to be able to do it. Now there is an error message that says my device is wither disconnected or stopped responding.
    But when I plugged in the Itouch, it still shows on my computer, still able to see my existing pictures in it. Just not able to paste/drag any new pictures into the folder.
    Anyone has this problem and able to solve it?
    Thank you.

    Hi BobRz
    Thanks for you suggestion but it didn't work - are there other ways for solving this problem? Or is it because my files that I want to copy and paste onto my hard disk etc are too big? (However there is space on my hard disk and it works on a PC)

  • HT1386 my pc crashed and I bought a new laptop and was able to recover all my music from the old hard drive and transfer it to the new pc.  I bought a new album on itunes and am unable to download it on my 6th nano even though I authorized the new pc.  An

    My old PC crashed and I ended up buying a new one.  I was able to recover all my music from the old hard drive and restore it in itunes.  I purchased a new album online thru itunes and added it to my library.  When I tried to add the album to my 6th nano it wouldn't download.  All the tracks are check marked and I can listen to the album on my pc but it won't sync onto the ipod.  The new pc is authorized, any ideas?

    You can only sysc with one iTunes library. The new computer is a new library. You have to restore your iPod on the new conputer and then sync.

  • How can i get all the records from three tables(not common records)

    Hi
    I have four base tables at R/3-Side. And i need to extract them from R/3-Side.
    And i dont have any standard extractor for these tables .
    If i create a 'View' on top of these tables. Then it will give only commom records among the three tables.
    But i want all the records from three base tables (not only common).
    So how can i get the all records from three tables. please let me know
    kumar

    You can create separate 3 datasources for three tables and extract data to BW. There you can implement business login to build relation between this data.

  • Trying to retrieve all the records from the file on desktop

    HI All
    I have one particular problem. I was given a text file which as 7000 records with length 512 each in a continues string. I Changed begining of each record with comma  in that text and saved it in .csv , when I try to upload the file into my program's internal table.
    It is still giving one record. I used
    itab_EXTRACT1 declared as
    DATA: begin of itab_extract OCCURS 0,
            extract1(512) type c,
          end of itab_extract.
    call method cl_gui_frontend_services => gui_upload
        exporting
          filename                = Xfile
        filetype                    = 'ASC'
         has_field_separator     = 'X'
        changing
          data_tab                = itab_EXTRACT1
      exceptions
        others                  = 17.
      Is there a way how to retrieve all the records into the internal table.
    Thanks
    Ravi

    Hi Ravi,
    I don't know if this is the correct solution, but I think it will work.
    Declare your internal table (itab_extract) with the maximum length which your file will occupy.
    Create another internal table (itab) with field (text) length 512.
    Populate the internal table itab_extract using GUI_UPLOAD.
    Then write this code
    l_index = 1.
    itab-text = itab_extract-extract1+0(512).
    append itab.
    do.
    n = ( l_index * 512 ) + 1.
    itab-text = itab_extract-extract1+n(512).
    append itab.
    if ( itab-text is initial ).
    exit.
    endif.
    enddo.
    Let me know if I miss anything.

  • Issue in retrieving all the records from ADF Table with multiple row

    Hi,
    As per my requirement, I need to fill the table with multi selected LOV values and when user clicks on commit, I need to save them to database.
    I am using ADF 11g, Multi select table. Using the below ADD method, I am able to add the records but if user clicks on cancel, I need to remove those from view and clear the table as well.
    But the Issue I am facing is, in my cancel method, always I am getting half of the records. Lets assume table contains 100 records but in my cancel method, I am getting only 50 records.
    Please let me know what is the issue in my source code.
    ADD Method:
    public void insertRecInCMProcessParamVal(String commType, String processType, Number seqNumber){       
    try{
    Row row = this.getCmProcessParamValueView1().createRow();
    row.setAttribute("ParamValue7", commType);
    row.setAttribute("ProcessType", processType);
    row.setAttribute("CreationDate", new Date());
    row.setAttribute("CreatedBy", uid);
    row.setAttribute("ParamValueSeqNum", seqNumber);
    row.setAttribute("ProcessedFlag", "N");
    this.getCmProcessParamValueView1().insertRow(row);
    }catch(Exception e){           
    e.printStackTrace();
    Table Code:
    <af:table value="#{bindings.CmProcessParamValueView11.collectionModel}"
    var="row"
    rows="#{bindings.CmProcessParamValueView11.rangeSize}"
    emptyText="#{bindings.CmProcessParamValueView11.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.CmProcessParamValueView11.rangeSize}"
    rowBandingInterval="1"
    selectedRowKeys="#{bindings.CmProcessParamValueView11.collectionModel.selectedRow}"
    selectionListener="#{bindings.CmProcessParamValueView11.collectionModel.makeCurrent}"
    rowSelection="multiple"
    binding="#{backingBeanScope.backing_app_RunCalcPage.t1}"
    id="t1" width="100%" inlineStyle="height:100px;" >
    <af:column sortProperty="ParamValue6"
    sortable="true"
    headerText="#{bindings.CmProcessParamValueView11.hints.ParamValue6.label}"
    id="c1" visible="false">
    <af:inputText value="#{row.bindings.ParamValue6.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue6.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue6.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue6.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue6.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue6.tooltip}"
    id="it3">
    <f:validator binding="#{row.bindings.ParamValue6.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="ParamValue7"
    sortable="true"
    headerText="Comm Type"
    id="c2">
    <af:inputText value="#{row.bindings.ParamValue7.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue7.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue7.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue7.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue7.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue7.tooltip}"
    id="it4">
    <f:validator binding="#{row.bindings.ParamValue7.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="ParamValue8"
    sortable="true"
    headerText="#{bindings.CmProcessParamValueView11.hints.ParamValue8.label}"
    id="c3" visible="false">
    <af:inputText value="#{row.bindings.ParamValue8.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue8.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue8.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue8.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue8.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue8.tooltip}"
    id="it2">
    <f:validator binding="#{row.bindings.ParamValue8.validator}"/>
    </af:inputText>
    </af:column>
    </af:table>
    Backing Bean Code:
    DCBindingContainer dcBindings=(DCBindingContainer)getBindings();
    DCIteratorBinding dcIterator=dcBindings.findIteratorBinding("CmProcessParamValueView1Iterator");
    RowSetIterator rs = dcIterator.getRowSetIterator();
    System.out.println("In Cancel Row Count is : "+ rs.getRowCount());
    if (rs.getRowCount() > 0) {
    Row row = rs.first();
    row.refresh(Row.REFRESH_UNDO_CHANGES);
    row.remove();
    while (rs.hasNext()) {
    int count = rs.getRowCount();
    System.out.println("Count is : "+ count);
    Row row = rs.next();
    System.out.println("Row === "+ row);
    if(row != null){                   
    row.refresh(Row.REFRESH_UNDO_CHANGES);
    row.remove();
    Thanks.

    Issue resolved.
    remove selectionListener and selectedRowKeys....
    code to get all the selectedRows.
    RowSetIterator rs = dcIterator.getRowSetIterator();
    RowKeySet rks = this.t1.getSelectedRowKeys();
    Iterator rksIter = rks.iterator();
    while (rksIter.hasNext()) {
    List l = (List) rksIter.next();
    Key key = (Key)l.get(0);
    Row row = rs.getRow(key);
    Thanks.

  • I use Acrobat to convert firefox pages to pdf and with firefox4 I need to be able to copy and pasted text from the pdf and no longer can.

    With the prior version of Firefox I could convert web pages (financial data) to pdf for maintaining historical files. And then with the pdf, I was able to copy and paste the numbers into Excel. With Firefox4, I can convert to pdf with Acrobat but I cannot access the numbers for copying and pasting as text, only as a picture. While I prefer Firefox, I check to see if this problem recently started with the "other" company's web browser and did not have this problem. So, it is not Acrobat.

    HI djlarp,
    Try triple-clicking in the text that you want to select--it can sometimes be tricky to select text in a converted document. If that doesn't work, it could be that the PDF document was created from a scanned document, and OCR wasn't enabled when you converted the document. (However, OCR is enabled by default when you convert via the ExportPDF website.)
    If you're unable to select text by triple-clicking, let us know. I would be happy to take a closer look at your files.
    Best,
    Sara

  • Not able to estabish connection with SQLServer2005 from the Topology Manage

    I have installed Oracle Data Integrator 10.1.3.4.0 and and Microsoft Sqlserver 2005 Management Studio Express in my windows system and created repository in Oracle Database 11g. I have also downloaded Microsoft SQL Server 2005 JDBC Driver Version 1.0 and placed the jar file in the <odi_home>/drivers Folder.
    I have to do a migration POC from Oracle DB 8i to Sqlserver(2005 express Edition) using ODI. In the Topology manager ,in the Physical Architecture
    I give the connections details : UserName :sa Password:sa that is the user of Sqlserver.
    Now in the JDBC Properties i give under jdbc Driver
    com.microsoft.sqlserver.jdbc.SQLServerDriver
    and jdbc URL
    jdbc:microsoft:sqlserver://10.177.62.148:1084
    The jdbc driver is not listed in the dropdown. I hardcode with com.microsoft.sqlserver.jdbc.SQLServerDriver which i found in ODI discussion forum.
    But I am getting the error ava.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getDriver(Unknown Source)
    Can anybody point me where I would be going wrong or is there any extra configuration I have to do.

    Hi Again,
    I have followed whatever you all have suggested. But could not succeed. Then I decided to use SQLServer 2000 express edition. Installed this in SQL authentication mode and I am able to connect from the management studio with the user sa and also from the command prompt. But again from ODI in the Topology manager I am facing the same problem.
    Now I select the default driver for sqlserver 2000 ie driver:com.microsoft.jdbc.sqlserver.SQLServerDriver
    and URL: jdbc:microsoft:sqlserver://10.177.62.148:1433
    or jdbc:microsoft:sqlserver://10.177.62.148:1433;SelectMethod=cursor
    gives me error javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    and unknown source at many places.
    I am using ODI 10.1.3.4 . Has anyone tested with the new release?

  • I am not able to install Scanner or scan from the Scanner to System.in laserjet 3055

    Laserjet 3055 Iam taking xerox / Printing from the Printer.  But not able to scan to computer.

    actually am not able to save them on my i phone , I actually deleted the folder which appears when we connect the I phone to the windows system (photo transfer without I tunes) I tried to restore it with I tunes and it started working but I loaded the backup the problem continued , one of my friend is also facing the same problem

  • Not able to extarct all product data from t code crmd_order

    Hi experts,
    My Datasource is 0CRM_SALES_CONTR_I.
    The data in the source system (CRM) looks like (in T-code crmd_order)
    Contract (header level)
    Setvice Item
    Material A
    Material B
    The Extractor (standard one) is picking up the Contact (header level) item, Service Item and the Material A.
    It is not picking up the Material B or C.
    is this the standard way it should work?
    At present it looks like
    Contract
    Service Item | Material A
    But it should look like
    Contract
    Service Item | Material A
    Service Item | Material B
    Can you suggest me how to do this?
    Should I enhance my Datasource?
    Any suggestions are welcome!
    regards,
    adlin

    Hi Adlin,
    For this datasource, we only consider the item category which belongs to
    BUS2000135
    BUS2000131
    BUS2000137
    BUS2000138
    BUS2000301
    BUS2000252
    BUS2000170
    BUS2000163
    You can find the codings in mapping function CRM_BW_SALES_CONT_I_MAP.
        LOOP AT ls_bdoc_msg-orderadm_i INTO ls_orderadm_i
             FROM item_tabix.
          IF NOT ls_orderadm_i-header EQ ls_orderadm_h-orderadm_h_guid.
            EXIT.
          ENDIF.
          IF ls_orderadm_i-object_type NE
             gc_object_type_item-cust_contract AND
             ls_orderadm_i-object_type NE
             gc_object_type_item-srv_contract  AND
             ls_orderadm_i-object_type NE
             gc_object_type_item-fin_contract  AND
             ls_orderadm_i-object_type NE
             gc_object_type_item-fs_loan  AND
             ls_orderadm_i-object_type NE
             gc_object_type_item-ubb_srv_contract  AND
             ls_orderadm_i-object_type NE gc_object_type_item-object AND
             ls_orderadm_i-object_type NE gc_object_type_item-invoice_req AND
             ls_orderadm_i-object_type NE gc_object_type_item-srv_plan_item.
            CONTINUE.
          ENDIF.
    Any other item will not be extracted by default.
    And you need to do enhancement by yourself using BAdI BWA_MFLOW.
    Hope my answer helps.
    Best Regards,
    Shawn

  • I am not able to save any pics taken from the phone ????????

    should i reset or what i have very imp data in it so can u advise me what to do

    actually am not able to save them on my i phone , I actually deleted the folder which appears when we connect the I phone to the windows system (photo transfer without I tunes) I tried to restore it with I tunes and it started working but I loaded the backup the problem continued , one of my friend is also facing the same problem

Maybe you are looking for

  • System Date in Query Designer

    I have a characterstic 'Deadline Date'. I have to calculate a formula 'Days Left' which is equal to Deadline Date - System Current Date. How can i do that in query designer?? How can i get system date in query designer?? Regards, Aisha Ishrat ICI Pak

  • How to trigger a hotsync from windows shortcut or on window start-up?

    The subject says it all, can we trigger a hotsync using a shortcut command or via a startup application? For the record, I have and use bluetooth for wireless sync. I am running Windows XP Post relates to: Treo 650 (Unlocked GSM)

  • Are these tables "derived" from the actual tables in the Entity Model? How to do this?

    I am trying to recreate a sample project (WPF with Entity Framework) that I believe was using EF4 - the Context.Template.cs file shows ObjectContext being used instead of DBContext.  The sample project contains its own Employee.mdf/Employee.ldf files

  • Outlook HyperLink from email that open SAP documents like BP or any other

    Is there a way today with latest version of SAP to have an hyperlink in an email that opens the document in SAP like the arrow in Crystal report which someone said it works today having a Crystal Report with a link to a SAP document.

  • Viewing PDFs in Safari in 64-bit mode - how?

    For me, in 64 bit mode, Safari insists on using Preview to view PDFs (and which is slow and clunky). If I make Safari downgrade itself to 32 bit mode, it properly calls up Acrobat to view PDFs. How can I have Safari running in native 64 bit mode and