For loop its taking time to execute if more records

Hi
I want to move the data with some condition and formatting which has 165000 rows in a table.
I want use loop to fetch these records and move to another table. I am using for .. loop to execute, its taking long time .
which way is better to execute fast?
Thanks in advance,
Maran

user8732035 wrote:
Hi
I want to move the data with some condition and formatting which has 165000 rows in a table.
I want use loop to fetch these records and move to another table. I am using for .. loop to execute, its taking long time .
which way is better to execute fast?
Thanks in advance,
MaranLooping is bad... it is actually row-by-row processing of data(i.e. slow-by-slow processing).
So, in place of using Pl/Sql, instead simply use a INSERT SQL query.
insert into <table1>
select col1,col2,... from <table2>
  where <condns>;HTH
Ranit B.

Similar Messages

  • MY QUERY IS TAKING TIME WHILE EXECUTING IN WAD

    HI BW GURUS
    If i execute the report(using query with variables) which contains 8,50,000 records in WAD then its taking more than 900 seconds and say Connection timed out at the end.
    If i execute the same query in Query designer using Web browser then it will take 400 seconds to show all the data in hierarchy or tabular view.
    I've done tuning using RSRT on query read mode and persistent mode etc..
    Can you please help me?

    Execution plan depends on many factors, statistics status of the objects, system statistics if you are using, init.ora parameters like mulitblock_read_count, parallellism, etc.
    If you want to use same execution plan for all database, you should refer stored_outline. In 10g you can try sql profiling.
    Ashok

  • Query taking time to execute

    Hello,
    i have created one query based on inventory cube 0IC_C03. when i am executing the infocube based on a particular date i am able to see the output but when i am executing the query on the basis of that particular date given while executing the cube the query is taking long time to execute and throwing a message of time limit exceed.
    could anyone suggest me why the query is showing such nessage along with resolution.
    Thanks,
    Kumkum
    Edited by: kumkum basu on Nov 29, 2010 2:33 PM

    Hi,
    There can be number of reason.
    What you can do is:-
    put the unwanted characteristics in Free Characteristics
    Remove unwanted cell reference
    Try using partitions in cubes
    Use aggregates for summarised data.
    f the above options doesnt work, then try pre-caching.This will definitely help!
    Use proper selections to get small subset of data.
    Goto RSRT>> type your query name>> Query properties>> select cache mode=4
    In addition to RSRT, ST05 (sql trace), SE30 (runtime analysis) and system statistics (ST03) may help you in identifying performance issues with a report.
    Thanks,.
    Saveen Kumar

  • Report is taking time to execute the following query

    Hi All,
    I have one query using in reports6i,which i am describing down,its taking half an hour to execute.
    I need to tune the query,if any one could help or any suggestions...........highly appreciable.
    SELECT +ALL_ROWS
    DISTINCT sm.orgn_code,
    sm.sample_no,
    -- DECODE (sm.batch_id, NULL, 'Item/Locn', 'Production') AS sample_type,
    NVL2(sm.batch_id, 'Production', 'Item/Locn') AS sample_type,
    sm.date_drawn,
    su.user_name AS drawn_by,
    im.item_no,
    lm.lot_no,
    im.inv_type,
    qt.test_code,
    rm.user_name AS result_by,
    rm.result_date,
    qt.test_type,
    qv.min_value_num,
    qv.max_value_num,
    DECODE(qt.test_type, 'N', TO_CHAR(qv.min_value_num) || ' - ' || TO_CHAR(qv.max_value_num), NULL) AS the_range,
    DECODE(qt.test_type, 'N', TO_CHAR(qv.target_value_num), qv.target_value_char) AS the_spec,
    DECODE(qt.test_type, 'N', TO_CHAR(rm.result_value_num), rm.result_value_char) AS the_result,
    DECODE(qt.test_unit, 'N/A', NULL, qt.test_unit) AS qc_uom,
    DECODE(sm.sample_disposition,
    '0RT',
    'RETAIN',
    '1P',
    'PENDING',
    '2I',
    'IN PROGRESS',
    '3C',
    'COMPLETE',
    '4A',
    'ACCEPT',
    '5AV',
    'ACCEPT WITH VARIANCE',
    '6RJ',
    'REJECT',
    '7CN',
    'CANCEL',
    NULL) AS disposition
    FROM gmd.gmd_samples sm,
    -- gmd.gmd_results rm,
    gmd.gmd_qc_tests_b qt,
    gmd.gmd_specifications_b sp,
    gmd.gmd_spec_tests_b qv,
    gmi.ic_lots_mst lm,
    apps.ic_item_mst im,
    applsys.fnd_user su,
    (SELECT gr.result_date,
    gr.sample_id,
    gr.test_id,
    gr.result_value_num,
    gr.result_value_char,
    ru.user_name
    FROM gmd_results gr,
    applsys.fnd_user ru
    WHERE (to_date(to_char(gr.result_date,'mm/dd/yyyy'),'mm/dd/yyyy') BETWEEN
    to_date(to_char(:p_2_start_date,'mm/dd/yyyy'),'mm/dd/yyyy') AND
    to_date(to_char(:p_3_end_date,'mm/dd/yyyy'),'mm/dd/yyyy'))
    AND gr.result_date IS NOT NULL
    AND ru.user_id = gr.last_updated_by) rm
    WHERE 1 = 1 --rm.result_date IS NOT NULL
    -- AND TO_DATE (TO_CHAR (rm.result_date, 'mm/dd/yyyy'), 'mm/dd/yyyy') >=TO_DATE (TO_CHAR (:p_2_start_date, 'mm/dd/yyyy'), 'mm/dd/yyyy')
    -- AND TO_DATE (TO_CHAR (rm.result_date, 'mm/dd/yyyy'), 'mm/dd/yyyy') <=TO_DATE (TO_CHAR (:p_3_end_date, 'mm/dd/yyyy'), 'mm/dd/yyyy')
    AND im.inv_type = NVL (UPPER (:p_inv_type), im.inv_type)
    AND sm.orgn_code = UPPER (:p_1_orgn)
    AND sm.item_id = lm.item_id --double
    AND sm.lot_id = lm.lot_id
    AND sm.item_id = lm.item_id --double
    AND sm.item_id = im.item_id
    AND sp.item_id = im.item_id
    AND rm.sample_id = sm.sample_id
    AND su.user_id = sm.sampler_id
    -- AND ru.user_id = rm.last_updated_by
    AND rm.test_id = qt.test_id
    AND qt.test_id = qv.test_id
    AND qv.spec_id = sp.spec_id
    AND sp.spec_status = 700
    AND qt.test_code LIKE NVL(:p_test, '%')
    AND ( ( qt.test_type = 'N'
    AND ( rm.result_value_num < qv.min_value_num
    OR rm.result_value_num > qv.max_value_num))
    OR ( qt.test_type <> 'N'
    AND rm.result_value_char <> 'OK'
    AND rm.result_value_char <> qv.target_value_char)
    Thanks in Advance

    You may want to consider demoralization views/tables or create indexes etc. to improve performance. Post it to
    PL/SQL
    to get more and quicker responses.

  • How would I implement a FOR loop in real time?

    I am using a cRIO and would like to have several processes running in parallel.  A main functin will have a loop in it which will count up and an certain time intervals pass data to a parallel process.  I am not sure how LV will check the current time value and determine if it is time to send the parallel process information (it will send the parallel process a command to start at time X and stop at time Y).  I see the code in C as:
    for (i; i <= 60; i++)
         if (i==30)
            Function(1); //send "1" to function to  start action, equivalent of setting a variable in LV and continuously reading that variable in the parallel function
         if(i==45)
            Function(0); //send "0" to function to stop condition
        delay(1second);
    I am confused about how to create a loop that has a predetermined (changeable) time period that allows me to compare the timer to set times (i.e. 30 and 45) and perform a function if they are equal.  I can handle that compare part but I am not sure how to implement the loop.  Any help would be greatly appreciated.

    Hi,
    Why don't you use "Elapsed time.vi" ? Compare it with the time you require. Also you can use register event function to let the other process know a certain condition has occurred.
    Gaurav k:smileyhappy:
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

  • Taking time to execute if where clause have  parathesis

    SELECT t0.CONVICTION_ID, t0.JDO_CLASS_TXT, t0.CONVICTION_CD, t0.CONVICTION_DT, t0.CONVICTION_DESC_CD, t0.CONVICTION_LEVEL_CD, t0.DRIVER_ID, t0.HIST_NUM, t0.LAST_UPD_DT, t0.REPORT_ID, t0.SOURCE_CD, t0.APPEAL_END_DT, t0.CASE_NUM_TXT, t0.CGI_VIOLATION_CD, t0.CONVICTION_LOC_TXT, t0.XREF_CASE_NUM_TXT, t0.CUM_DEMERIT_NUM, t0.DEMERIT_THIS_OFFENSE_NUM, t0.END_DT, t0.OFFENCE_TYPE_CD, t0.PROV_CONVICTION_CD, t0.REINSTATE_DT, t0.SEVERITY_CD, t0.START_DT
    FROM CUSTOMER.RDB_EIG_DD_CONVICTIONS t0
    WHERE t0.DRIVER_ID = :1
    SELECT t0.CONVICTION_ID, t0.JDO_CLASS_TXT, t0.CONVICTION_CD, t0.CONVICTION_DT, t0.CONVICTION_DESC_CD, t0.CONVICTION_LEVEL_CD, t0.DRIVER_ID, t0.HIST_NUM, t0.LAST_UPD_DT, t0.REPORT_ID, t0.SOURCE_CD, t0.APPEAL_END_DT, t0.CASE_NUM_TXT, t0.CGI_VIOLATION_CD, t0.CONVICTION_LOC_TXT, t0.XREF_CASE_NUM_TXT, t0.CUM_DEMERIT_NUM, t0.DEMERIT_THIS_OFFENSE_NUM, t0.END_DT, t0.OFFENCE_TYPE_CD, t0.PROV_CONVICTION_CD, t0.REINSTATE_DT, t0.SEVERITY_CD, t0.START_DT
    FROM CUSTOMER.RDB_EIG_DD_CONVICTIONS t0
    WHERE (t0.DRIVER_ID = :1)

    When you're query takes too long...
    When your query takes too long ...

  • In one website, it takes to much time to load the page, in other site its not taking time, so do i need to enable or change any settings

    in one website, its taking time to load the page, on other PC its not taking any time( with internet explorer) in my PC other websites are opening quickly but this website takes too much time with firefox

    Zepo wrote:
    My iMac has been overwhelmed almost since I bought it new.  After some digging the guiness bar suggested its my Aperture library being on the same
    internal Tera byte drive as my operating system.
    Having a single internal hard drive overfilled (drives slow as they fill) is very likely contributing to your problems, but IMO "my Aperture library being on the same internal Tera byte drive as my operating system" is very unlikely to be contributing to your problems. In fact the Library should stay on an underfilled (roughly, for speed, I would call ~half full "underfilled") internal drive, not on the Drobo.
    Instead build a Referenced-Masters workflow with the Library and OS on an internal drive, Masters on the Drobo, OS 10.6.8 (there have been issues reported with OS 10.7 Lion). Keep Vault backup of the Library on the Drobo, and of course back up all Drobo data off site.
    No matter what you do with i/o your C2D Mac is not a strong box for Aperture performance. If you want to really rock Aperture move to one of the better 2011 Sandy Bridge Macs, install 8 GB or more of RAM and build a Referenced-Masters workflow with the Library and OS on an internal solid state drive (SSD).
    Personally I would prefer investing in a Thunderbolt RAID rather than in a Drobo but each individual makes his/her own network speed/cost decisions. The Drobo should work OK for referenced Masters even though i/o is limited by the Firewire connection.
    Do not forget the need for off site backup. And I suggest that in the process of moving to your new setup it is most important to get the data safely and redundantly copied and generally best to disregard how long it may take.
    HTH
    -Allen Wicks

  • How to know which sql query is taking time for concurrent program

       Hi sir,
    I am running concurrent program,that is taking time to execute ,i want to know which sql query causing performance
    Thanaks,
    Sreekanth

    Hi,
    My Learning: Diagnosing Oracle Applications Concurrent Programmes - 11i/R12
    How to run a Trace for a Concurrent Program? (Doc ID 415640.1)
    FAQ: Common Tracing Techniques in Oracle E-Business Applications 11i and R12 (Doc ID 296559.1)
    How To Get Level 12 Trace And FND Debug File For Concurrent Programs (Doc ID 726039.1)
    How To Trace a Concurrent Request And Generate TKPROF File (Doc ID 453527.1)
    Regards
    Yoonas

  • PartitionOn taking time

    Hi All,
    We have weekly maintainence for essbase cube. There are total 2 source cubes and target cubes for the reporting purposes. The target cubes are accessed through the
    partitions. During weekend maintainence process we load the data into the cube and in the end we run the Partitionon.bat script to create partition betweeb the cubes
    here the problem comes "the script is common for all the countries but for some countries the script excutes in 20 min and for some countries it takes nearly 1hr even
    though the cube size is very less when compared with the countries which execute first".
    Thanks in advance.

    Hi MattRollings ,
    As i said we are having two types of partitions one is for statitic reports and the another for the dyanmic reporting. yes the script which we use to for partitionon will create the partitions. The Script is common for all the countries and the script runs like this
    1.First it creates the Transparent partition.
    2.Then to create the Replica it refreshes from the two source cubes after that aggregation happens asually.
    The main problem comes here during the refresh from the source to the Target its taking time. To say exactly during the refresh from source to the replica its taking 15min. For the other countries its taking only 8 min of time.
    I have gone ahead to compare two different countries replica cubes size what i found is that one country cube size is 2Gb and the another one is 2.5Gb the one which is having less size taking 20min to complete and the other one takes 1hr time. Even though the second one is .5GB extra when compared with the first it should take 25min to create the replica partition.
    what might be reason to consume more time while creating replica partition? Is it dependent on Defined Blocks, Actual Blocks,Non missing leaf blocks etc?
    Thanks Matt in advance.

  • LabVIEW 6.1 If For Loop count terminal is zero then value going through the loop is not passed on to the output of the loop

    Hello, one of our customers just encountered an execution error in a vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or 6.01. I have a simple vi that has two encapsulated For Loops. Two string arrays go in, one goes out of the outer loop. Inside the outer loop the first array is indexed. The string which results from this indexing is compared with all other strings from the second string array in the inner loop. If it matches one of the strings of the second array, it is not outputted, otherwise this string goes through the inner For Loop to the output of the inner loop and from there to the output of the outer loop. The count
    terminal of the outer/inner loop is connected to the Array Size of the first/second string array. If the second array is empty, that means that the element in test from the first arry cannot match anything from the second array, so the element in test is send to the output of the inner loop and from there to the output of the outer loop. This works fine in LabVIEW 5.1 and 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never executed if the count value is zero (which is correct), but the data line running through the loop is not executed either, which is different to what LabVIEW 5.1 and 6.01 do. There, the input string is sent to the output of the inner loop correctly even if the loop counter is zero. The solution is easy - I just have to connect the output of the outer loop to the data line BEFORE it enters the inner loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is supposed to be a feature, but it brings some incompatibility in programming between the
    different LabVIEW versions.
    Best regards,
    Gabsi

    Hi,
    When a for-loop runs zero times, all outputs are 'undefined' (and should
    be).
    Besides, how would LV know what the output of a not executed routine should
    be?
    It might be handled differently in LV5 and LV6, which is unfortunate. In
    both cases, the result is undefined.
    It's not a bug. It's just something that should be avoided in any LV
    version.
    > The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    In some cases this does the trick. But if the data is changed in the inner
    loop, this will effect the results if the N is not zero.
    Technically, I think the output in this construction is also 'undefined'.
    But LV handles this as expected / desired.
    Another solution is to use a shift register. If N is zero, the input is
    directly passed through to the output.
    Regards,
    Wiebe.
    "Gabs" wrote in message
    news:[email protected]...
    > LabVIEW 6.1 If For Loop count terminal is zero then value going
    > through the loop is not passed on to the output of the loop
    >
    > Hello, one of our customers just encountered an execution error in a
    > vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or
    > 6.01. I have a simple vi that has two encapsulated For Loops. Two
    > string arrays go in, one goes out of the outer loop. Inside the outer
    > loop the first array is indexed. The string which results from this
    > indexing is compared with all other strings from the second string
    > array in the inner loop. If it matches one of the strings of the
    > second array, it is not outputted, otherwise this string goes through
    > the inner For Loop to the output of the inner loop and from there to
    > the output of the outer loop. The count terminal of the outer/inner
    > loop is connected to the Array Size of the first/second string array.
    > If the second array is empty, that means that the element in test from
    > the first arry cannot match anything from the second array, so the
    > element in test is send to the output of the inner loop and from there
    > to the output of the outer loop. This works fine in LabVIEW 5.1 and
    > 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never
    > executed if the count value is zero (which is correct), but the data
    > line running through the loop is not executed either, which is
    > different to what LabVIEW 5.1 and 6.01 do. There, the input string is
    > sent to the output of the inner loop correctly even if the loop
    > counter is zero. The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    > supposed to be a feature, but it brings some incompatibility in
    > programming between the different LabVIEW versions.
    > Best regards,
    > Gabsi

  • Query takes time to execute

    I am creating a jsp application . . . .I am retreiving some values from my database oracle 10g..my query taking time to execute even in isql plus..am uisng tomcat5 and oracle 10gR2..can anyone pls tell me why it happens...my query fetches data from four tables...i dont know exactly why its taking so muc time say 50seconds...when i run the application in my local host it retrievs fast when i do that in server it creates a problem..
    Actually it works fine when i deployed in my client server it takes time sometimes it takes atmost one minute
    1.pls tell me how can i test my query about the performance
    2.is der any command in oracle to test
    3.how much bytes it takes

    Look at this thread...
    When your query takes too long ...

  • Application server 10g R2 taking time to load.

    hi all.
    i am using oracle Application server 10g R2 when i boot my windows server 2003 R2 then
    its taking time to load application server more than 5 min what is the problem
    why its taking time to load?
    any onw knows?

    JVM (java virtual machine) If you have a full stack, infrastructure + BI forms you need 2 gb at least only to install, if you plan to make some work on it it could happen that the computer get very slow.
    In opmn.xml file, in the seccion for the home container (or other you are using) there is a line for Start Parameters, there you have to use the -Xmx1024M to se the maximum JVM size to 1gb, for this you will have to restart the proc.
    For forms also there are some procs where you manage the size of the memory and procs, you can see this in the Configuration Seccion into the EM Console.
    Regards

  • Selecting with rownum=1 taking time

    Hi, I am using below script in one of my PL/SQL program. The strange thing is that this is taking time to execute. But If we gather stats on user_scheduler_job_run_details, it executes quickly. Looks like it is doing a full table scan in the 1st  case. Any idea about why this is happening.   SELECT *   FROM user_scheduler_job_run_details   where ROWNUM = 1 Thanks.

    Hi,
    1) USER_SCHEDULER_JOB_RUN_DETAILS is a view. How do you collect optimizer stats on a view?!
    2) "the strange thing is that this is taking time to execute" -- there is nothing strange about that. Everything takes time. How much time does the query take exactly?
    3) "looks like it is doing a full table scan" -- post appropriate diagnostic information for this query, e.g. SQL real-time monitor output, dbms_xplan.display_cursor output or tkprof'ed trace file.
    Best regards,
      Nikolay

  • Double for loop

    Hi,
    I am trying to modify the content of a 2D for loop using a double for loop. But the result I am getting is always 0 in the loop i am getting... I am not really too sure of the problem. Can anyone help?
    Thanks
    Attachments:
    example2.vi ‏32 KB

    The results are not 0. the VI has replaced all of the elements in the intial array with random numbers. You've got an initial array with 3 rows and 3 columns but your inner for loop iterates 10 times. You cannot do a replace array element on an array element that is empty. You simply have to set the iteration count of the inner most for loop to be the same as the number of columns. You did that with the outermost for loop. Why did you use a constant of 10 for the inner loop?

  • Last pulse high for longer period of time

    Hi guys
    Me again with another problem.
    I am attaching the VI with the post. Now the VI generating pulses of 100 Hz frequency(clock, which is connected to signal generation block). Now all the 63 pulses are coming correctly but last pulse high for almost 30 mSec. I could not find a solution. Could DAQ task is not be clearing properly??? I am at lost...Any help???? Thanks in advance.....
    Attachments:
    telecommand_1.vi ‏62 KB

    You have to change the numeric constant (connected to the "Eaqual to")from 63 to 62 in your for loop. Remember that "i" starts with the value 0. Since the for loop runs 63 times you will never get 63 as value for "i".
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway

Maybe you are looking for

  • I cannot get email set up correctly on my 4s using a Pop3 account and a BTConnect email address. How do I do it please?

    Hi, I have an iphone 4S and am trying to set up mail so that I can send and receive relating to our home email account which is unfortunately a "btconnect" address and a POP3 account. How do I do it please? BT seem unable to supply IMAP settings. Do

  • Photoshop Elements 5.0--Deactivate

    How do I deactivate Photoshop Elements 5.0 and Premier Elements 3.0? Currently, my computer is not hooked up to the internet--I realize it needs to be before deactivating (not a problem). But when I look at PS Elements or Premier Elements>Help, there

  • Just upgraded to Yosemite, now Final Cut Pro doesn't work

    Hi I just upgraded to Yosemite 10.10 on a 2010 MacBook Pro, and the only major tool I use on there now doesn't work.... Final Cut Pro 10.0.9. The icon in the tray has a line through it and when you click on it, a panel opens advising that I can't use

  • Oracle Applications Release 12.1.1 installation on windows 2003  failed

    Hi All, I am installing oracle 12.1.1.0 on windwos 2003 SP2. I received some errors at the step 1 of 5 and till 13% of installation. THe following are the errors reported in the Install log file located at: Database logfile - F:\oracle\VIS\db\tech_st

  • Locking enclosures for APs

    What types of locking enclosures do you guys use for the 3500 series both internal and external antennas? I've been using some made by Terrawave, worked pretty well for the 1130s. They are a good size, the few others I've seen have been enormous. Can