Will using for loop decrease the performance

Hi,
Will using for loop with a query decrease the performance.
for r_row in (select * from table) Loop
end loop.
This is done inside another for loop, most of the cases it returns only one value.
will it decrease the peformance of the procedure.
kindly advice.......
Regards,
Balu

user575682 wrote:
Will using for loop with a query decrease the performance.
for r_row in (select * from table) Loop
end loop.
This is done inside another for loop, most of the cases it returns only one value.
will it decrease the peformance of the procedure.Perhaps it is better to understand just what this PL/SQL loop construct does.
PL/SQL is two languages. It is PL (programming logic code) like Pascal or C or Java. You can use a 2nd language inside it called SQL. The PL engine is clever enough to recognise when the 2nd language is used. And it compiles all the stuff that is needed for the PL engine to call the SQL engine, pass data to the SQL engine and get data back, etc. (compare this with the complexity of using the SQL language in Pascal or C or Java).
So what does that loop do? The PL engine recognises the SQL SELECT statement. It creates an implicit cursor by calling the SQL engine to parse it (hopefully a soft parse) and then execute it.
As part of the PL loop, the PL engine now calls the SQL engine to fetch the data (rows) from the cursor. With 10g and later, the PL engine is smart enough to use implicit bulk processing.
Prior to 10g it used to fetch a row from the SQL engine, do the loop, fetch the next row, do the loop, etc. This means if there is a 1000 rows to fetch, it will call the SQL engine a 1000 times.
With 10g and later it will fetch a 100 rows, store that in an internal buffer and then do the loop a 100 times. With a 1000 rows to fetch, it now only requires 10 bulk fetches instead of a 1000 single row fetches.
These fetches require a context switch - as the PL engine has to step out and into the SQL engine and back, to fetch a row. This is an overhead and thus can become slow the more context switching there is.
And this is the basics for this loop (and most other cursor loops) construct in PL/SQL.
The ideal is to reduce the number of context switches. This is an overhead that can impact on performance.
What about using a loop within a loop. Also "bad". This uses the outer loop to fetch data. This data is then used to drive the fetch in the inner or nested loop. So the outside loop pulls data from the SQL engine into PL variables. The inside loop pushes that very same data back to the SQL engine.
Why? It would have been a lot faster no to pull and push that data between the loops using PL.
It will be a lot faster doing it via SQL only. Write both loops as a single SQL statement and have the SQL engine directly drive these loops itself. This is called a JOIN in SQL. And the SQL engine can do it not only faster, but it has some froody algorithms that can be used that are even faster than a nested loop process (called merge joins, hash joins, etc).
Bottom line. Maximise SQL. Minimise PL.*
Do as much of your data crunching in SQL as possible. SQL is the best and fastest "place" to process data. Not PL (or Pascal/C/Java).

Similar Messages

  • Breaking a single query using for loop to improve performance

    Hi,
    This is a continuation of my previous post which I marked Answered and few things are were left from my side and I was advised to post a new thread...
    [Will it be a good ply|http://forums.oracle.com/forums/thread.jspa?threadID=880922&tstart=0]
    will it be applicable to any query because I took this to simplify the thing to explain my case
    which is actually........... pull the data from some tables using joins and insert into some other tables .....
    I used few procedures for diff conditions one of them use plain' insert into select' and others use bulk collect technique.
    I followed the simple strategy (for DML ) by Tom Kytes ..and Steven Feuerstein
    Use single statement whenever it is possible..
    if not use PL/SQL with bulk collect to avoid for loop.
    Please correct me if I am wrong.
    Thanks and Regards,
    Hesh.

    A simple test can prove the case
    SQL> set serveroutput on
    SQL>
    SQL> create table t
      2  as
      3  select * from all_objects where 1=2
      4  /
    Table created.
    SQL> declare
      2    ltime integer;
      3  begin
      4      ltime := dbms_utility.get_time;
      5      insert into t select * from all_objects;
      6      ltime := dbms_utility.get_time - ltime;
      7
      8      dbms_output.put_line(ltime);
      9  end;
    10  /
    187
    PL/SQL procedure successfully completed.
    SQL> rollback
      2  /
    Rollback complete.
    SQL> declare
      2      ltime integer;
      3      type tbl is table of t%rowtype index by pls_integer;
      4      l_tbl tbl;
      5      cursor c
      6      is
      7      select * from all_objects;
      8  begin
      9      ltime := dbms_utility.get_time;
    10      open c;
    11      loop
    12          fetch c bulk collect into l_tbl limit 500;
    13          exit when c%notfound;
    14
    15          forall i in 1..l_tbl.count
    16            insert into t values l_tbl(i);
    17      end loop;
    18
    19      ltime := dbms_utility.get_time - ltime;
    20
    21      dbms_output.put_line(ltime);
    22  end;
    23  /
    390
    PL/SQL procedure successfully completed.
    SQL> rollback
      2  /
    Rollback complete.

  • So many loops decreasing the performance

    So many loops are in loop, Is there any other statement to improve the performance
    LOOP AT p0000 WHERE begda LE pn-endda
                    AND   endda GE pn-begda.
        wa_datatab-pernr = p0000-pernr.
        LOOP AT p0001 WHERE begda LE p0000-endda
                      AND   endda GE p0000-begda.
          wa_datatab-werks = p0001-werks.
          wa_datatab-bukrs = p0001-bukrs.
          wa_datatab-persg = p0001-persg.
    read technical date of entry and first working day
          CLEAR emp_period.
          LOOP AT p0041.
            CLEAR p41dat.
            DO 12 TIMES
                  VARYING p41dat FROM p0041-dar01 NEXT p0041-dar02.
              IF ( p41dat-dar EQ ca_dar01 OR
                   p41dat-dar EQ ca_dar04 OR
                   p41dat-dar EQ ca_dar40 ) AND
                   NOT p41dat-dat IS INITIAL.
                PERFORM employment_period USING p41dat-dat
                                                pn-begda
                                                emp_period.
                CASE p41dat-dar.
                  WHEN ca_dar01.
                    wa_datatab-dat01 = p41dat-dat.
                    wa_datatab-dat01_period = emp_period.
                  WHEN ca_dar40.
                    wa_datatab-dat40 = p41dat-dat.
                    wa_datatab-dat40_period = emp_period.
                  WHEN ca_dar04.
                    wa_datatab-dat04 = p41dat-dat.
                    wa_datatab-dat04_period = emp_period.
                ENDCASE.
              ENDIF.
            ENDDO.
          ENDLOOP.
        ENDLOOP.

    hi check this prog how to get the best performance..
    report ztest.
    tables:pa0002,pa0008,pa0021,pa0041.
    data: begin of itab occurs 0,
          pernr like pa0002-pernr,
          vorna like pa0002-vorna,
          nachn like pa0002-nachn,
          end of itab.
    data: begin of itab1 occurs 0,
          pernr like pa0008-pernr,
          begda like pa0008-begda,
          stvor like pa0008-stvor,
          ansal like pa0008-ansal,
          end of itab1.
    data :begin of itab2 occurs 0,
          pernr like pa0021-pernr,
          favor like pa0021-favor,
          fanam like pa0021-fanam,
          end of itab2.
    data:begin of itab3 occurs 0,
         pernr like pa0041-pernr,
         dar01 like pa0041-dar01,
         dat01 like pa0041-dat01,
         end of itab3.
    data:begin of final occurs 0,
          pernr like pa0002-pernr,
          vorna like pa0002-vorna,
          nachn like pa0002-nachn,
          begda like pa0008-begda,
          stvor like pa0008-stvor,
          ansal like pa0008-ansal,
           favor like pa0021-favor,
          fanam like pa0021-fanam,
         dar01 like pa0041-dar01,
         dat01 like pa0041-dat01,
         end of final.
    select-options:s_pernr for pa0002-pernr,
                         s_date for sy-datum.
    select pernr
           vorna
           nachn
           from pa0002
           into table itab
           where pernr in s_pernr
           and begda le s_date-low
           and endda ge s_date-high.
    select pernr
           begda
           stvor
           ansal
           from pa0008
           into table itab1
           for all entries in itab
           where pernr = itab-pernr
           and begda le s_date-low
           and endda ge s_date-high.
    select pernr
           favor
           fanam
           from pa0021
           into table itab2
           for all entries in itab1
           where pernr = itab1-pernr
          and begda le s_date-low
           and endda ge s_date-high.
    select pernr
           dar01
           dat01
           from pa0041
           into table itab3
           for all entries in itab2
           where pernr = itab2-pernr
           and begda le s_date-low
           and endda ge s_date-high.
    loop at itab.
    final-pernr = itab-pernr.
    final-vorna = itab-vorna.
    final-nachn = itab-nachn.
    read table itab1 with key pernr = itab-pernr.
    final-begda = itab1-begda.
    final-stvor = itab1-stvor.
    final-ansal = itab1-ansal.
    read table itab2 with key pernr = itab1-pernr.
    final-favor = itab2-favor.
    final-fanam = itab2-fanam.
    read table itab3 with key pernr = itab2-pernr.
    final-dar01 = itab3-dar01 .
    final-dat01 = itab3-dat01.
    append final.
    clear final.
    endloop.
       loop at final.
       write:final-pernr ,
    final-vorna ,
    final-nachn ,
    final-begda ,
    final-stvor ,
    final-ansal ,
    final-favor ,
    final-fanam ,
    final-dar01 ,
    final-dat01 .
       endloop.
    regards,
    venkat.

  • How do i sweep two voltage at the same time by using for loop ?

    Hello, Can anyone help me on this topic ?
    My problem is to sweep Vds and Vgs as same time vs Id in MOSFET by using for loop. I also use the Agilent power supply source. Let me tell a litle bit about what i'm doing. For different value of Vds, i will get Vgs vs Id curve. (The x axis is Vgs, the y-axis is Id).
    I started to create two for-loop, the inner to sweep Vgs, and the outer one to sweep Vds. My problem is don't know how to connect all the wire in  the for loop.
    In the for loop i saw N, i icon. Suppose I have the two variable for Vgs such as Vgs start and Vgs_stop. Should the Vgs_start( or Vgs_stop) be connected to N or leave it in the for_loop ?
     for example: I want to sweep Vgs from 0(for Vgs_start)  to  5(Vgs_strop) V, and the step increment is .5V how do i connect these variables in the for loop ?
    Thank you for your time
    Ti Nguyen

    It is easier to use a while loop.  Dennis beat me to the punch.  Here is my solution:
    You can remove the flat sequence structure if you use Error In and Error Out to ensure the execution flow will occur in the proper order.  Be sure to include the delay time in the loop so that your vi doesn't hog all the CPU time.
    Message Edited by tbob on 10-17-2005 01:00 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    RampVoltage.PNG ‏8 KB

  • How to use no of iteration of for loop as the input for the for loop

    hi all,
    i wanna need some help here..
    i'm using for loop to iterate to ceratin no of iteration.. then, i would like to use back the no of iteration as the input of 'N' for the next iteration..
    in other word, eg:
    1st run:
    i insert a control to 'N', let say 80
    then the iteration run until 80-1 = 79..
    2nd run:
    i need to insert the no of "N", let say a control of 120.. i want the loop run for "120 - 79", where the 79 is the no of previous run..
     easy to say,
    how can i connect the "i' as a control to ''N''
    n how to make a "run' or ' GO' and ''stop'' button in the front panel and block diagram after the first run without using the stop and run from the labview window
    thanks..

    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
    Attachments:
    Untitled 2.vi ‏9 KB

  • HT201250 i am using for first time the time machine and an external hard drive because I want to erase my macbook and start from zero files. do i keep my files in the portable hard disk when I connect it again with the macbook or the time machine will era

    i am using for first time the time machine and an external hard drive because I want to erase my macbook and start from zero files. Am i keeping my files in the portable hard disk when I will connect it again with the macbook or the time machine will erase all?
    I would like to know if after I erase all my data, empy hard drive inside the macbook, the time machine will erase all my files that I have saved in my "WD "My passport" external hard drive

    Welcome to Apple Support Communities
    Time Machine has to erase the external disk in order to make backups. Before setting Time Machine up, copy the files of your external disk to the hard disk of the Mac in order not to lose them, and then, set up Time Machine. The first backup will start automatically.
    If you want more information about Time Machine, read the Pondini's site > http://pondini.org

  • Question about using for-loop to generate array from DAQmx. Thanks!

    I have a laser system with a frequency of 1kHz, I am using this 1kHz signal to trigger the DAQmx and get the data from a photodetector, e.g. I will get 1000 data points during 1 second from DAQmx, but I need to separate this 1000 data points into the even and odd list, which is two list of 500 data points, e.g.. The 1st, 3rd, ... 99th data is one array, the 2nd, 4th,... 10th data is another array, then I will do further calculations based on these two arrays.
    To seperate the even and odd data, the only way I can find is put these 1000 points into an array and then seperate them afterwards.
    Can I do things like this pic?
    I don't know the speed of the for loop, because the 1kHz trigger is always there, once it is triggered, the DAQmx read will give a data point, if the speed of the for-loop( the time from the end of a loop to the beginning of the next loop) is slower than the 1kHz trigger, then the for-loop will miss data point, then the ordering of the 1000 points in 1 second will be changed.
    Or I need to put everything, e.g. AI Voltage, Trigger, sample clock, into the for-loop and then return a Y? Thanks! 

    Clarification:
    The VI you have posted will work as following:
    1) The task will read 2 analog inputs (ai0, ai3).
    2) The acquisition starts, oncece digital signal (trigger) is detected on PFI0
    3) The sampling rate will be as specified in "rate" control - it is continuous analog input acquisition, which means that after trigger is received (point 2), the board will start to generate hardware clock with frequency you specify as "rate"
    4) with each rising edge of that hardware clock, the measurement is taken, and stored into buffer of driver.
    5) DAQmx read will try to read "number of samples per channel" number of samples each time is called - and if there is not enough measurement stored in buffer (step 4), then DAQmx read will wait until DAQ card will measure reaquested number of samples (or timeout occurs before requested number of samples has been acquired)
    6) DAQmx read will be then called 1000 times - so totaly you will read 1000 * "number of samples per channel"  number of samples.
    You do not have to be worried about speed of the loop. In fact, if you need to read just 1000 samples, with 1kS/s, then you can remove for loop and you can change measurement mode from continuous to finite samples, and specify number of samples to read to be 1000. You will read them all properly. I recomend you to read User Manual for your DAQ device - lets say M Series User Manual.
    I hope it is clear now.
    regards,
    stefo

  • Build 1D array using for loop

    Hi guys,
    I am testing out array. How do I create a 1D array of x-y using for loop?

    Nextal wrote:
    I am testing out array. How do I create a 1D array of x-y using for loop?
    OK, first of all you did not say what the array should contain. If you want an array that has one array element for each iteration of the while loop, you need to first think a bit harder. Your outer loop has no wait, thus it will spin millions of times per second and you will run out of memory soon, no matter how much memory you have. How many times should the while loop iterate? If you know the number before the program starts, you would use a FOR loop and autoindex at the loop boundary.
    If you want to use a whiile loop, you need a mechanism to keep the array size reasonable. For small final arrays, you can just build the array in a shift register if you need it updated as it happens. If you only need the array after the loop stops, you can autoindex at the right loop boundary.
    In any case, you should take a step back and decide what you really want. Currently the specifications are very vague and unreasonable.
    LabVIEW Champion . Do more with less code and in less time .

  • How to iterate List in jsp without using for loop

    Hi,
    I am developing a small application is struts. I have one ActionForm file which contain one List like getEmployeeDetailsList(). When I am using this list in jsp page for displaying data. I want to display it as employee name, employee address, employee designation and employee contact no. These all fields are available in the above list. Now what is the problem is that I am using logic:iterate method to iterate data. but this is not sufficient to display all records in order. like employee name should be in one table and they can be vertical not horizontal, employee address is also should be seperate. and same thing with employee designation and contact no. I don't want to use for loop to iterate this list. Please tell me about optionCollection for this list. only employee names should be one drop down and employee designation is also in another drop down.
    Please help. It is really urgent.
    Any help will be appreciated.
    Thanks in advance.
    Manveer

    I'm not sure what you problem is, but one thing you can do is to create a new class and pass the list into its constructor (and store it as a private variable). Then, provide a set of functions in the new class that extracts data from the list and returns it in a form that the various parts of the JSP page wants. For example, one function may return a sorted list of just the employee names. In this way, all the business logic for formatting the data into a form that JSP page likes is hidden inside the new class.

  • After update to IOS 7.1 Mobile Operator decreased the performance of Iphone 5s.

    After update to IOS 7.1 Mobile Operator decreased the performance of Iphone 5s. When  the cell of my current mobile is active Iphone 5s works so bad. It is not fast and it takes 3 seconds when you wanna enter to any section. I have changed my mobile operator and it worked fine after the change.It is so interesting that how it can happen? It happened after IOS7.1. And several people have the same problem with their Iphone 5s after update to IOS7.1. And thay all using the same mobile operator that I used before.
    I have called to the customer service of mobile operator. But they say that there is no any problem with their cell. Buit in fact a lot of people have  problem on their Iphone 5s after IOS 7.1 update and they are all using the same mobile operator

    HOTSPOT Problems with iOS 7.1
    Settings for hotspot connections have been changed by Apple at the request of some carriers.  IF your carrier is not on this list http://support.apple.com/kb/HT1937 then you cannot connect using hotspot.. Complain to your carrier

  • How do I use For loop to check each node and import them to a new document?

    In my function I would like to use a For loop to get all the statutes (xml) inside the object
    objXmlBcaResponseDoc. In my case there are 2 statutes. I would like the output to look like the one I have posted here below. I am not sure how to do the For loop. The commented For loop is from another function but it is not working inside
    this function.
    The output is added into the **objXmlResponseMessageDoc** object and should look like this with 2 statutes (ns1:Statute) and a totalCount=2
    <BasicSearchQueryResponse xmlns="http://crimnet.state.mn.us/mnjustice/statute/service/4.0">
    <StatutesXml>
    <Statutes runType="Request" runDateTime="2015-03-17T10:23:04" totalCount="2">
    <ns1:Statute xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0">
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">8471</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">60</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">55</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0"/>
    </ns1:Statute>
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">9722</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">90</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">25</Section>
    <Subdivision xsi:nil="true" xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0"/>
    </ns1:Statute>
    </Statutes>
    </StatutesXml>
    </BasicSearchQueryResponse>
    My xml doc is found inside objXmlBcaResponseDoc Here is xml inside
    objXmlBcaResponseDoc object
    <BasicSearchQueryResponse xmlns="http://crimnet.state.mn.us/mnjustice/statute/service/4.0">
    <ns1:Statutes xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0">
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">8471</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">60</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">55</Section>
    <Subdivision xsi:nil="true" xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0"/>
    </ns1:Statute>
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">9722</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">90</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">25</Section>
    <Subdivision xsi:nil="true" xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0"/>
    </ns1:Statute>
    </BasicSearchQueryResponse>
    Here is my function
    Function GetStatutesByChapter(ByVal aobjXmlGetStatuteRequestNode As XmlNode, ByVal aobjXMLNameSpaceManager As XmlNamespaceManager, ByVal aobjBroker As ServiceCatalog.Library.v4.Broker) As XmlDocument
    Dim objXmlRequestMessageDoc As XmlDocument
    Dim objXmlResponseMessageDoc As XmlDocument
    Dim intCount As Integer
    aobjBroker.PostMessageWarehouseInformationalMessage("Chapter found.", 1)
    objXmlResponseMessageDoc = New XmlDocument
    'Add the first element into the document GetStatuteByChapter with its namespace
    objXmlResponseMessageDoc.AppendChild(objXmlResponseMessageDoc.CreateElement("BasicSearchQueryResponse", "http://crimnet.state.mn.us/mnjustice/statute/service/4.0"))
    'Build the initial response document
    objXmlResponseMessageDoc = New XmlDocument
    'Add the first element into the document GetStatutesResponse with its namespace
    objXmlResponseMessageDoc.AppendChild(objXmlResponseMessageDoc.CreateElement("GetStatutesResponse", "http://www.courts.state.mn.us/StatuteService/1.0"))
    'Add a child node to the GetStatutesResponse node
    objXmlResponseMessageDoc.SelectSingleNode("ss:GetStatutesResponse", aobjXMLNameSpaceManager).AppendChild(objXmlResponseMessageDoc.CreateElement("StatutesXml", "http://www.courts.state.mn.us/StatuteService/1.0"))
    objXmlResponseMessageDoc.SelectSingleNode("ss:GetStatutesResponse/ss:StatutesXml", aobjXMLNameSpaceManager).AppendChild(objXmlResponseMessageDoc.CreateElement("Statutes", "http://www.courts.state.mn.us/StatuteService/1.0"))
    'Convert the node Statutes into an element and set the runType attribute (runType="Request") by adding it's value Request
    CType(objXmlResponseMessageDoc.SelectSingleNode("ss:GetStatutesResponse/ss:StatutesXml/ss:Statutes", aobjXMLNameSpaceManager), System.Xml.XmlElement).SetAttribute("runType", "Request")
    'Convert the node Statutes into an element and set the attribute (runDateTime="2015-03-05T10:29:40") by adding it
    CType(objXmlResponseMessageDoc.SelectSingleNode("ss:GetStatutesResponse/ss:StatutesXml/ss:Statutes", aobjXMLNameSpaceManager), System.Xml.XmlElement).SetAttribute("runDateTime", Format(Now, "yyyy-MM-ddTHH:mm:ss"))
    'Create the BCA request message
    objXmlRequestMessageDoc = New XmlDocument
    objXmlRequestMessageDoc.AppendChild(objXmlRequestMessageDoc.CreateElement("ns:BasicSearchQueryRequest", aobjXMLNameSpaceManager.LookupNamespace("ns")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns1:BasicSearchCriteria", aobjXMLNameSpaceManager.LookupNamespace("ns1")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest/ns1:BasicSearchCriteria", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns2:Chapter", aobjXMLNameSpaceManager.LookupNamespace("st")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest/ns1:BasicSearchCriteria", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns2:Section", aobjXMLNameSpaceManager.LookupNamespace("st")))
    objXmlRequestMessageDoc.SelectSingleNode("ns:BasicSearchQueryRequest/ns1:BasicSearchCriteria", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns2:Subdivision", aobjXMLNameSpaceManager.LookupNamespace("st")))
    'Uncomment last working section below
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Chapter", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Chapter", aobjXMLNameSpaceManager).InnerText
    'check if there is a section and or subdivision if it is there then set the value
    If Not (aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager) Is Nothing) Then
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Section", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Section", aobjXMLNameSpaceManager).InnerText
    End If
    If Not (aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Subdivision", aobjXMLNameSpaceManager) Is Nothing) Then
    objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns1:BasicSearchCriteria/st:Subdivision", aobjXMLNameSpaceManager).InnerText = aobjXmlGetStatuteRequestNode.SelectSingleNode("ss:Statute/ss:Subdivision", aobjXMLNameSpaceManager).InnerText
    End If
    'check if there is a section and or subdivision if it is there then set the value
    aobjBroker.PostMessageWarehouseSnapshot(objXmlRequestMessageDoc.OuterXml, "Request Message", 1)
    'Call the BCA service
    intCount = 0
    'This is where I want to use a For loop to check for the statutes found using the Chapter
    'Loop through each Id
    'For Each objXmlStatuteIdNode In aobjXmlGetStatuteRequestNode.SelectNodes("ss:Statute/ss:StatuteId/ss:Id[string-length(.)>0]", aobjXMLNameSpaceManager)
    'Create the BCA request message
    'objXmlRequestMessageDoc = New XmlDocument
    'objXmlRequestMessageDoc.AppendChild(objXmlRequestMessageDoc.CreateElement("ns:SingleStatuteRequest", aobjXMLNameSpaceManager.LookupNamespace("ns")))
    'objXmlRequestMessageDoc.SelectSingleNode("ns:SingleStatuteRequest", aobjXMLNameSpaceManager).AppendChild(objXmlRequestMessageDoc.CreateElement("ns:statuteId", aobjXMLNameSpaceManager.LookupNamespace("ns")))
    'objXmlRequestMessageDoc.DocumentElement.SelectSingleNode("ns:statuteId", aobjXMLNameSpaceManager).InnerText = objXmlStatuteIdNode.InnerText aobjBroker.PostMessageWarehouseSnapshot(objXmlRequestMessageDoc.OuterXml, "Request Message", 1)
    'intCount = intCount + 1
    'objXmlBcaResponseDoc = New XmlDocument
    'File name is BCASearchQueryResponse.xml
    'objXmlBcaResponseDoc.Load("\\j00000swebint\mscapps\deve\appfiles\temp\BCASearchQueryResponse.xml")
    'objXmlResponseMessageDoc.DocumentElement.SelectSingleNode("ss:StatutesXml/ss:Statutes", aobjXMLNameSpaceManager).AppendChild(objXmlResponseMessageDoc.ImportNode(objXmlBcaResponseDoc.DocumentElement.SelectSingleNode("ns1:Statute", aobjXMLNameSpaceManager), True))
    'Next
    'Count how many Statute nodes found
    CType(objXmlResponseMessageDoc.SelectSingleNode("ss:BasicSearchQueryResponse/ss:StatutesXml/ss:Statutes", aobjXMLNameSpaceManager), System.Xml.XmlElement).SetAttribute("totalCount", CStr(intCount))
    Return objXmlResponseMessageDoc
    End Function

    What is XPath and what does it do that you're impressed with?
    Yes, I see your link, but give me the abbreviated elevator speech on what it is please. It has me curious.
    http://searchsoa.techtarget.com/definition/XPath
    http://www.techrepublic.com/article/easily-navigate-xml-with-vbnet-and-xpath/
    http://www.techrepublic.com/article/using-xpath-string-functions-in-xslt-templates/
    The way that all this is being used by me now on a project is the HTML controls on the screen are built by XML not only about what the controls are and their attributes,   but the data from from the database is XML too with both going through transfermations
    vis XSLT as the HTML controls are built dynamically by XML data for the controls and the XML database data with decision being made in the transfermation on the fly.
    There are many usages with Xpath not just this one I am talking about with Xpath. You can do the same kind of thing with XAML and WPF forms as they are dynamically built. But it goes well beyond what I am talking about and the usage of Xpath. Xpath 3.0
    is the latest version. 
    http://www.balisage.net/Proceedings/vol10/html/Novatchev01/BalisageVol10-Novatchev01.html
    Thanks - I'll look into that at some point.
    Still lost in code, just at a little higher level.

  • Can I legally use for commercial purposes the Photoshop CS6 Extended Student Version?

    Can I legally use for commercial purposes the Photoshop CS6 Extended Student Version or do I have to get the Photoshop CS6 Extended normal (commercial) version? I want to make a game and I'll use things created in Photoshop, like images. And I'll sell this game, so I'll get money with it: it's something commercial. Do I have to get the commercial version for that or can I use a Student's one?
    And can I make what I need to do in a trial version and then pay the license before selling the game or it's obligatory to have the license since the beggining?
    See you!

    TheNextRiser wrote:
    And can I make what I need to do in a trial version and then pay the license before selling the game or it's obligatory to have the license since the beggining?
    You can start work on your game from the moment you download and complete the installation of the Trial version.
    No-one will be standing over you watching what you do or monitoring you remotely or noting when you pay for the software.
    You can buy the software at any time during the Trial period. However, after a maximum 30 days of using the Trial, you will have to pay to keep using the software.
    Other than that, do what you like with the Trial.
    (If you somehow finish the game after 20 days of using the Trial then you can start selling the game even if you have not yet purchased the software.)

  • Nested for loop in the collections

    Hi Experts,
    collection1
    ============
    SELECT o.object_id
          BULK COLLECT INTO l_obj_info
            FROM (SELECT     n.node_id, n.object_id
                        FROM nodes n
                  START WITH n.node_id = 100
                  CONNECT BY PRIOR n.node_id = n.parent_node_id) n
                 INNER JOIN
                 objects o ON n.object_id = o.object_id
           WHERE o.object_type_id = 285;
    collection2
    ============
    SELECT *
          BULK COLLECT INTO l_tab
            FROM ((SELECT     REGEXP_SUBSTR (i_l_text, '[^,]+', 1, LEVEL)
                         FROM DUAL
                   CONNECT BY REGEXP_SUBSTR (i_l_text, '[^,]+', 1, LEVEL) IS NOT NULL));
       END;
    collection3
    ============
    SELECT o.object_id
                   BULK COLLECT INTO l_fin_tab
                     FROM objects o JOIN ATTRIBUTES att
                          ON o.object_id = att.object_id
                    WHERE o.object_id = collection1.object_id
                      --AND att.VALUE = collection2.val;
    Please tell me how to implement for loop in the collection3 to get the values from collection1 and collection2.
    i have tried in the below way
    CREATE OR REPLACE TYPE LIST_OF_ATTRIBUTES_TYPE AS TABLE OF varchar2(4000);
    CREATE OR REPLACE TYPE LIST_OF_OBJECT_IDS_TYPE AS TABLE OF number(9);
    CREATE OR REPLACE FUNCTION f_get_objects_by_type_id (
       i_object_type_id   IN   NUMBER,
       i_l_text           IN   VARCHAR2,
       i_scope_node_id         NUMBER
       RETURN list_of_object_ids_type
    AS
       CURSOR objs_info
       IS
          SELECT o.object_id
            FROM (SELECT     n.node_id, n.object_id
                        FROM nodes n
                  START WITH n.node_id = i_scope_node_id
                  CONNECT BY PRIOR n.node_id = n.parent_node_id) n
                 INNER JOIN
                 objects o ON n.object_id = o.object_id
           WHERE o.object_type_id = i_object_type_id;
       l_tab       list_of_attributes_type := list_of_attributes_type ();
       --l_obj_info   list_of_object_ids_type := list_of_object_ids_type ();
       l_fin_tab   list_of_object_ids_type := list_of_object_ids_type ();
    BEGIN
       BEGIN
          SELECT *
          BULK COLLECT INTO l_tab
            FROM ((SELECT     trREGEXP_SUBSTR (i_l_text, '[^,]+', 1, LEVEL)
                         FROM DUAL
                   CONNECT BY REGEXP_SUBSTR (i_l_text, '[^,]+', 1, LEVEL) IS NOT NULL));
       END;
       IF l_tab.COUNT > 0
       THEN
          FOR i IN objs_info
          LOOP
             FOR j IN l_tab.FIRST .. l_tab.LAST
             LOOP
                SELECT o.object_id
                BULK COLLECT INTO l_fin_tab
                  FROM objects o JOIN ATTRIBUTES att ON o.object_id =
                                                                     att.object_id
                 WHERE
                                att.VALUE = l_tab (j) and o.object_id =objs_info(i);
             END LOOP;
          END LOOP;
       END IF;
       RETURN l_fin_tab;
    END f_get_objects_by_type_id;

    Why are you wanting to do this?
    It looks like you are trying to implement SQL joins in PL code.  Not only is that using up expensive PGA memory by storing the data in collections, but doing such retrieval of data to try and join it in PL loops, is never going to be as fast as just joining the SQL queries using SQL itself.
    Post some example data and your database version, with an example of what the output should look like from that example data.
    Re: 2. How do I ask a question on the forums?

  • How do I  save and re-use a fillable form once I have created it? It is a form i will use for multiple medcial clients I see, then print out and put in paper chart, and then do it again for another patient. - I just got Acrobat XI

    I've created a fillable form from a Word document, but how do I save and re-use a a fillable form once I have created it? It is a form I will use for multiple medical patients, printing out the filled in form to put in paper chart (no need to save filled out form), and then fill blank form again for another patient? - I just got acrobat X

    Thanks!
    That should also save the blank form for future re-use, right.?
    Can I also file the blank form in the file system, and then retrieve it as a blank form when I have a next patient need for it?
    Thanks
    Michael

  • HT1918 I am trying to enter the No. Of my VISA card (which I normaly use for payments) in the billing info of my account and it is not accepted. Does anyone have any idea why?

    I am trying to enter the No. Of my VISA card (which I normaly use for payments) in the billing info of my account and it is not accepted. Does anyone have any idea why?

    JarleEkanger wrote:
    How about this? Use Delete array subset to extract chunks for averaging, and a shift register to retain the remaining array.
    It is typically not advisable to use "delete from array" in a tight loop. The constant memory reallocations due to array resizing are probably inefficient.
    Here's one simple way to do it..
    (If the number of points is not divisible by 10, the excess tail is discarded. You can easily modify that behavior if desired.)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    averages of 10.png ‏5 KB
    averages of 10.vi ‏9 KB

Maybe you are looking for