How dicrease the time for a bult insert.

Hi, we have a the following process..
1) create a cursor
2) insert in a table t1 acording the rows
selected in the cursor
3) a before insert on t1 create others rows on t2, t3...
This proccess cteate about 300,000 rows a take near 3 hours... my question is how dismiss this time???

Lets imagine I want to INSERT 10 rows into the following table, set a sequential product i.d. for each record and a quantity of zero:
CREATE TABLE sales (product_id NUMBER(10),
quantity NUMBER(5)) ;
Traditionally, I might write something like this (O.K., I know I could use a single INSERT statement for this, but let's assume you want to do some additional calculation inside the loop) :
BEGIN
FOR i IN 1..10 LOOP
INSERT INTO sales (product_id,quantity)
VALUES(i,0) ;
END LOOP ;
COMMIT ;
END ;
All well and good - except each INSERT causes the PL/SQL engine to request that the SQL engine should insert 1 row. This is an overhead that can be reduced by using BULK BIND coding (I mixed my terms previously - a BULK COLLECT allows multiple rows to be retrieved into a PL/SQL collections - it uses the same performance-enhancing technique, but in reverse) :
DECLARE
TYPE t_sales IS TABLE OF sales.product_id%TYPE INDEX BY BINARY_INTEGER ;
a_sales t_sales ;
BEGIN
FOR i IN 1..10 LOOP
a_sales(i) := i ;
END LOOP ;
FORALL j IN a_sales.FIRST..a_sales.LAST
INSERT INTO sales (product_id,quantity)
VALUES (a_sales(j),0) ;
COMMIT ;
END ;
The INSERT above is now passed to the SQL engine as a single request, which gives a significant performance improvement for large numbers of rows. Just remember that all those rows need to go somewhere in memory prior to the INSERT - namely the PGA for your session.
There are a few limitations to this method, the most significant being that fact that the PL/SQL table must be "simple" - i.e. no tables or records.
(Oracle Moderators: Please don't ask "Why is Andy writing such an pointless piece of code?" - it's just to demonstrate the technique!)
null

Similar Messages

  • Extending the time for a photo inserted into Motion timeline

    I'm a newbie to Motion and I've downloaded the dvMatte for Motion so I can do what I hope to do, which is to shoot a short Monthly PodCast in front of a green screen and insert a Virtual Set behind me.
    I insert my clip into motion, apply the dvMatte filter, then add a picture of the virtual set as a layer to the timeline.
    It looks great, initially. But the image/picture is inserted with a duration of only 3 seconds. I can't seem to locate a way to extend the duration for that picture to the same as that of the keyed clip.
    The clip is, in this case only 8 seconds. So I end up with a great 3 seconds of my virtual set with me in front of it, then just the black matte behind me.
    Are photos not permitted to be extended?

    Bob, take the time to thank those who helped (especially Nipsey since he figured out what was going on) by clicking on the or the over people's posts.
    see:
    New Discussions ResponsesThe new system for discussions asks that after you mark your question as Answered, you take the time to mark any posts that have aided you with the tag and the post that provided your answer with the tag. This not only gives points to the posters, but points anyone searching for answers to similar problems to the proper posts.
    If we use the forums properly they will work well...
    Patrick

  • A previous and unrelated text always appears when I need to send a new text. This prevents forwarding texts also, which I need to do all the time for my business. How can I fix? Please help!

    A previous and unrelated text always appears when I need to send a new text. This prevens forwarding texts also, which I need to do all the time for my businss. How can I fix? Please help?

    Hi,
    This sounds like it is about Window positions.
    iChat has Default places for Incoming Invites.
    Video is always top Center of your Screen
    Audio and Text chats are Upper right with the Audio slightly lower than Text Chats.
    Secondary invites are sort of Stacked like when you open multiple files from the same App.
    Your outgoing Windows are "Remembered" as to where the last one was when you used it.
    This can be an issue if you use your Mac with a second display and turn Off Mirroring.
    You windows can get "left" on the other screen.
    Go to System Preferences > Displays and turn On Mirroring and the windows should come back to one Screen/display.
    If this does not help go to your Home Folder/Library/Preferences and delete (Drag to Trash) com.apple.ichat.plist and restart iChat.
    Unfortunately you will need to reset any iChat Preferences you have changed from defaults.
    10:42 PM      Tuesday; April 26, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
    , Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How do you set the time for this forum??? Not in nerd pleas

    how do you set the time for this forum?

    There were problems with the correct time display for postings, and based on another recent post this doesn't seem to have been fixed. My advice... don't worry about it.

  • How to increase the time for threadstuck jdeveloper weblogic server

    Hi,
    This is a requirement for increasing the time for threastuck detection in jdeveloper weblogic server.
    Few of my threads take a longer time than the default value for threastuck detection.
    Could you please share the suggestions on how to do it?
    i have tried by creating workmanager from the administration console but not aware of how to apply it to application(in web.xml).
    Share inputs on this.
    Thanks,
    Devender

    You are posting this on the wrong forum. All this in one of the server forums.
    Timo

  • How to increase the time for detect a device down on Prime 2.0

    Hi,
    I would like to know how to increase the time for detect when a device has lost connection, currently I monitor several stand alone Access Points that are paleced on differents locations connected to prime through 256 Mbps Links, so when the location has very high bandwith utilization, an e-mail notification about the unreachable Access Point is sent, but if we check te reachability, the Access Point is reachable, and we don´t want to receive to many of this notificatios,
    thanks for your help

    Go to the Console,   Select the server --> configuration --> tuning tab, 
                        Stuck Thread Max Time and Stuck Thread Timer Interval  (give your required time)
    This will definitely increase the Stuck Thread time interval.
    or
    by using work manager also you can define Stuck Thread Max Time interval by editing deployment descriptor file
    <work-manager>
    <name>wm_name</name>
      <max-stuck-thread-time>30</max-stuck-thread-time>
    <stuck-thread-count>5</stuck-thread-count>
    </work-manager>

  • How to reduce the time for each clips up to 0,04 seconds?

    Hi, I'm trying to realize my first time laps. I've need to reduce the time for each clips up to 0,04 seconds, but it seems that the minimum time is 0,1 second. There's a solution?

    And use a zip file.  Many people can't open RARs.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • My battery runs low very fast (three hours). I looked in the usage settings and it seems the time for usage and stand-by are the same, allthough i did have my iphone on stand-by!! What can i do?

    Community,
    I have a problem with my iphone 4. Every few months my battery starts draining within a few hours. I have tried all kinds of battery saving tips, but they don't help. When i go to the settings/general/usage is can see that the time for Usage and Stand-by are the same, so my phone is fully on all the time this explains the draining. But in reallity i turn my phone to stand-by most of the time, i mean the screen is black and all???
    The first and second time a had this problem, both a few months a part,  i restored my phone and it was solved. This time i restored my phone but this did not help!! And restoring my phone every two months is not my preferd way of solving this problem.
    Does anybody have an idea on how to solve this problem? can anybody help me?
    best regards,
    Merijn

    Restoring is the answer. It sounds as if there is a rogue process constantly draining your battery.
    The issue you face is that, if you restore your backup thereafter, you risk the problem coming straight back with your files.
    Store your files individually and it is time to start fresh.

  • Capturing the time for rendering the JSFscreen.

    I have a JSF application running on WAS6.1. We have some performance issues.
    The JSF rendering is taking long time to render the page. All the database operation ie querying the database and leaving the prerender method is happening so fast.
    So how can we capture the time for the JSF components to render the page. Is there any way to do that?

    i tried to implement the phase listener.But i’m getting an error message in the JSP saying
    JSPG0046E: Unable to locate tagfile for tag phaseListener
    My action getting triggered on click of a tab. So in my JSP page I mentioned as
    <ui:tab action="#{reportsView.kpiRanking_action}" binding="#{reportsView.kpiRankingStore}"
    id false*/;&#xa;openPreloadWindow(); &#xa;document.getElementById("form1:periodTypeDropDown")[2].selected = true;&#xa;savePeriodType();"
    style="height: 25px; text-align: center; vertical-align: middle; width: 91px;cursor: pointer;" text="Store KPI Ranking">
    <f:phaseListener binding="#{reportsView.phaseListenerImpl}" type="com.capricorn.sckpi.PhaseListenerImpl"/>
    <ui:panelLayout binding="#{reportsView.layoutPanel30}" id="layoutPanel30" style="height: 335px; width: 100%; overflow-y: auto;">
    <ui:table augmentTitle="false" binding="#{reportsView.storeWithinDistrictTableStore}"
    id="storeWithinDistrictTableStore"
    style="height: 100%; left: 0px; top: 0px; position: relative; width: 100%" title="KPI Ranking">
    <ui:tableRowGroup binding="#{reportsView.storeWithinDistrictRowGroupStore}"
    id="storeWithinDistrictRowGroupStore" sourceData="#{reportsView.defaultTableDataProvider}" sourceVar="currentRow"/>
    </ui:table>
    <ui:table augmentTitle="false" binding="#{reportsView.storeWithinDistrictTableStore1}"
    id="storeWithinDistrictTableStore1"
    style="height: 100%; left: 0px; top: 0px; position: relative; width: 100%" title="YTD Ranking">
    <ui:tableRowGroup binding="#{reportsView.storeWithinDistrictRowGroupStore1}"
    id="storeWithinDistrictRowGroupStore1" sourceData="#{reportsView.defaultTableDataProvider}" sourceVar="currentRow"/>
    </ui:table>
    </ui:panelLayout>
    </ui:tab>
    My header for JSP is
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    Please help.

  • How will the Time Capsule support IPv6 and coop with the new emerging security threats that will emerge due to the new technical possibilities that IPv6 provide?

    How will the Time Capsule support IPv6 and coop with the new emerging security threats that will emerge due to the new technical possibilities that IPv6 provide?

    Cross your fingers and hope.
    Obviously if there is any big or known threat Apple will send out a firmware fix.
    But the TC is designed to be end user simple device. It has no firewall that is visible at any rate. I don't know that it truly doesn't have a firewall but it is not part of the end user controls.
    IMO if you have major security concerns that go beyond end device firewall, which is where Apple do put most of the security, since firewall in the router is plainly not a stop to anybody deliberately downloading an infected file or website, and most end users.. do not want a firewall that prevents them using the web like a business does, where only certain ports are allowed. Everything else tough luck.. you are not allowed to use it. Then TC is unsuitable for you anyway.. buy a proper firewall appliance.

  • Saving to SharePoint works only half the time for Windows 7 Users--all the time for Windows XP users

    We have a SharePoint 2010 Environment with hardware load balancing, 2 WFEs, 2 Apps Servers and 1 SQL Server. This was built in October 2013. Office Integration and Saving back to SharePoint works all of the time for users on XP. It works sporadically for
    users on Windows 7. When Windows 7 users do the following:
    Opening an Office Document from computer and saving it to SharePoint
    Within a Document Library, using Save As from an opened document
    When selecting in a Document Library from the Document Tab> “New” and then the desired content type
    Send> Save to SharePoint from within Office Document
    They may either be brought to the SharePoint library (correct) or to My Documents (incorrect).
    In the case of number 1 (Opening an Office Document from computer and saving it to SharePoint)--using Save and Send will sometimes open the SharePoint library and sometimes open My Documents.
    Our URL is https://CompanyName.domainname.com/Sites/SiteCollectionName
    The intermediary "Sites" is actually a blank path.
    When My Documents is opened I've noted with Fiddler (a web debugger) that we get a 404 on sites:
    Could this be the issue?

    Some things to double check:
    Ensure that you have sticky sessions enabled on your load balancer
    Check that your WebDav calls are making it to the server
    Ensure that you have a root site collection in all your web apps
    Just out of curiosity, what is the http request look like for the 404 error?
    Chris Givens CEO, Architecting Connected Systems
    Blog Twitter

  • We have an issue when we send a film to the media encoder it crashes about half of the time for no particular reason. Anyone else got that too with Premiere Pro CC and the new Media encoder? Thanks! bedrijfsfilm Companyfilms

    We have an issue when we send a film to the media encoder it crashes about half of the time for no particular reason. Anyone else got that too with Premiere Pro CC and the new Media encoder?

    We have an issue when we send a film to the media encoder it crashes about half of the time for no particular reason
    Anyone else got that too with Premiere Pro CC and the new Media encoder?
    Lack of detailed info makes your question impossible for anyone to answer you!
    eg. ...."Doctor it hurts...anyone else got something that hurts?" 

  • My ping is 500+ all the time for no reason.

    hey basically my ping is like 500+ all the time for no reason at all
    thats my adsl status
    ADSL line status
    Connection information
    Line state
    Connected
    Connection time
    0 days, 5:42:31
    Downstream
    5,088 Kbps
    Upstream
    448 Kbps
    ADSL settings
    VPI/VCI
    0/38
    Type
    PPPoA
    Modulation
    ITU-T G.992.1
    Latency type
    Interleaved
    Noise margin (Down/Up)
    14.9 dB / 23.0 dB
    Line attenuation (Down/Up)
    26.0 dB / 15.5 dB
    Output power (Down/Up)
    19.8 dBm / 12.3 dBm
    Loss of Framing (Local)
    0
    Loss of Signal (Local)
    0
    Loss of Power (Local)
    0
    FEC Errors (Down/Up)
    1553 / 0
    CRC Errors (Down/Up)
    42 / N/A
    HEC Errors (Down/Up)
    N/A / 0
    Error Seconds (Local)
    34

    Hello ,
    Also we need a speedtest just to have a look and make sure everything's okay? Use this link http://bit.ly/uViAXN and post all the required info Throughput, IP Profile etc..). If that one doesn't work then try this work around link http://bit.ly/sYcqhk .
    Can you also run a test at http://www.pingtest.net and also do websites load slowly?
    Can you also confirm if you're connected at the master socket or an extension? And what your type your master socket is according to this picture
    Are you connected Wirelessly or through a cable?
    Regards Edd
    Check your Line
    BT Speedtester

  • Is there way to configure the Time for attribute Description?

    Hi All,
    We have a requirement that …
    If we provide description (Tooltip) for attribute in Fact or Dimension it is displaying in couple of Seconds. Is there any way that configure to change the Time for attribute Description (Tooltip) Display Time ?
    Thanks in advance

    I should note that the time stays on the left of the event name when I re-enter the text (which I had to do all the time before I found the "show event times" button) so I feel like there's a way.

  • [login root user] - increase the time for authentification ROOT user in SH

    Hello,
    We have a server in production when OS version MACOSX 10.4.11 Tiger
    The last week our monitorin system failed because the ssh session return time out.
    I try login from Terminal and X11 and the time for autentification the ROOT sh session is betwen 40 and 80 seconds. (login to SSHD, login in sh shell, login in xterm, ......
    Why root autentification in SSH an SH login have increased? Can you help me?
    Marc

    Hi Marc, and a warm welcome to the forums!
    No expert here at all, but does this offer a clue...
    http://search.cpan.org/~stevegt/IPC-Session-0.05/Session.pm

Maybe you are looking for

  • Payload missing in Soap document

    We use XI 3.0, R3->XI->WebService scenario From my SoapDocument, i don't see the payload being part of the <Body>. Hence we get the "Object reference not set to an instance of an object" exception, from the WS - <SOAP:Envelope xmlns:SOAP="http://sche

  • "The folio included in this application is missing."

    I'm getting that error, anybody get the same? I'm stumped and confused.

  • File Open By Another Application

    I am trying to use an application to Sync files on 2 different IMACs across a Local Network. Many of the Syncs are failing because the Application claims that Files are exclusively Opened by another Application. I know that this is NOT true since I h

  • FF and Safari position fix

    This was the last post in a thread earlier today. When no vertical scrollbar is required centered a web page will jump about 5px to the right compared to the position when scrollbar is present. I'm reposting it because I wanted everyone to have a cha

  • How do I combine audio tracks in Premiere Elements 7?

    My audio cable went bad as I was recording a program on my camcorder. It only recorded one track. Is there a way to combine these two tracks or Copy & paste one track to the other? Thanks