Increment loop in the 12 th iteration

Hi Guys,
How to do this....
For the First 11 Iteration do not increment my counter,after then increment the counter by 1 in the 12 th Iteration..then do not increment the counter upto the 23 rd iteration then on the 24 th iteration icrement by 1...goes on....how to do this.
Example.....
31-MAR-2001 ....c = 1
31-MAR-2002 ... c = 2
31-MAR-2003 ... C = 3
etc.....
exit the loop when 31-mar-2006 comes...
How to do this.plz help..
Gita

I suspect this is not the wanted o/p.Then pls give a clear sample o/p
sql>select * from t;
DT SNO 
31-MAR-01  1 
31-MAR-02  2 
31-MAR-03  3 
31-MAR-04  4 
31-MAR-05  5 
sql>
declare
n number;
begin
select count(*)
into n
from t;
for i in 1..n loop
  for rec1 in (select dt,sno,nvl(lead(dt) over(order by sno),add_months(dt,12)) dt1 from t)   loop
    dbms_output.put_line(rec1.dt||' to '||rec1.dt1||' '||'yr='||rec1.sno) ;
  end loop;
end loop;
end;
31-MAR-01 to 31-MAR-02 yr=1
31-MAR-02 to 31-MAR-03 yr=2
31-MAR-03 to 31-MAR-04 yr=3
31-MAR-04 to 31-MAR-05 yr=4
31-MAR-05 to 31-MAR-06 yr=5
31-MAR-01 to 31-MAR-02 yr=1
31-MAR-02 to 31-MAR-03 yr=2
31-MAR-03 to 31-MAR-04 yr=3
31-MAR-04 to 31-MAR-05 yr=4
31-MAR-05 to 31-MAR-06 yr=5
31-MAR-01 to 31-MAR-02 yr=1
31-MAR-02 to 31-MAR-03 yr=2
31-MAR-03 to 31-MAR-04 yr=3
31-MAR-04 to 31-MAR-05 yr=4
31-MAR-05 to 31-MAR-06 yr=5
31-MAR-01 to 31-MAR-02 yr=1
31-MAR-02 to 31-MAR-03 yr=2
31-MAR-03 to 31-MAR-04 yr=3
31-MAR-04 to 31-MAR-05 yr=4
31-MAR-05 to 31-MAR-06 yr=5
31-MAR-01 to 31-MAR-02 yr=1
31-MAR-02 to 31-MAR-03 yr=2
31-MAR-03 to 31-MAR-04 yr=3
31-MAR-04 to 31-MAR-05 yr=4
31-MAR-05 to 31-MAR-06 yr=5
PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • 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

  • When I add a while loop to the vi "niScope EX Multi-Device Configured Acquisition (TClk)" to acquire data for multiple times, it works but it runs very slowly.

    Because I want to acquire the similar data for multiple times and then take an average to increase SNR, I add a while loop to the vi "niScope EX Multi-Device Configured Acquisition (TClk)".  It works but it runs very slowly (about 1 sec for each iteration). I think I had put the while loop at a wrong position, which makes the vi run from the very beginning in each iteration. So I really want to know where should I put the while loop to improve the speed? I have attached all the vi and subvi.
    Thanks very much.
    Attachments:
    Multi-Device External Clocking (TClk).vi ‏1166 KB
    avgWfm.vi ‏15 KB

    Dear Zainykhas,
    Thank you for posting this to the discussion forums and for uploading some sample code.  I took a lok at the issue you have been having, and it is unclear to me as to why you have placed two for loops around the original while loop.  My understanding is that you want to use the original Sample.vi and want to execute this N times where N is the Max Freq divided by Interval so that you can scan for a range of frequencies.
    Why not just put Sample.vi around one for loop and use the increment counter scaled by the interval to count up towards Max Freq and insert the desired Frequency into the cluster using Bundle By Name?
    Kind Regards,
    Robert Ward
    Applications Engineer, NI
    Attachments:
    Modified - RW.vi ‏48 KB

  • "for each" loop - under the hood question

    Question about the for each loop. Is it optomized? I think this is a poor use of memory management -
    for (int i = 0; i < stop; i++) {
    Object obj = new Object();
    doSomething(obj);
    }And this is the ideal, using the same object -
    Object obj = new Object();
    for (int i = 0; i < stop; i++) {
    doSomething(obj);
    }So underneath the hood, which is the for each loop comparable to? I love the syntax, it's very clean-looking in the code, but at the same time I don't want to hurt performance.

    Question about the for each loop. Is it optomized? I
    think this is a poor use of memory management -
    for (int i = 0; i < stop; i++) {
    Object obj = new Object();
    doSomething(obj);
    }And this is the ideal, using the same object -
    Object obj = new Object();
    for (int i = 0; i < stop; i++) {
    doSomething(obj);
    }So underneath the hood, which is the for each loop
    comparable to? I love the syntax, it's very
    clean-looking in the code, but at the same time I
    don't want to hurt performance.That depends on YOU. You CANNOT write a for-each loop for the code you provided. A for-each loop requires an Iterable. (I think that's what it requires--it at least requires something to iterate over, not just an index variable as you have.)
    Consider the following, however:
    Object o1 = new Object();
    for (Foo foo : fooList) {
        Object o2 = new Object();
         foo.doStuff(o1, o2);
    } It will be equivalent to this:Object o1 = new Object();
    for (Iterator iter = foo.iterator(); iter.hasNext();) {
        Foo foo = (Foo)iter.next();
        Object o2 = new Object();
        foo.doStuf(o1, o2);
    } How could it be any different? It has to keep the behvior of the "old fashioned" iteration.

  • Stopping a while loop using the time difference of two tick counts

    Hi Guys,
    I'm currently writing a code which test how long does it take for a formula node to perform its operation. The program uses a while loop to perform the calculation, and the program stops after calculating when tick count has reached 10 seconds. The program then displays the number of iterations it does in 10 seconds. 
    So initially I created 2 frames of sequence structure. In my first frame I have my initial tick count, and in my second frame I have my final tick count and the while loop. I used the subtract function and divide the output by 1000 to get the time difference. Then using the comparison function, I set if output > 10 then the program should stop, to do this I linked the output of the comparison function to the stop button inside the while loop. 
    However, when I tried to run the code, the program just didn't run. Hence I created a similar program which puts the last tick count in new frame sequence. When I ran this code, the program never stopped. 
    Do you guys have any idea what went wrong with my codes.
    Thank you!
    Erry
    Solved!
    Go to Solution.
    Attachments:
    1. Tick Count.vi ‏27 KB
    tickcoun2.vi ‏27 KB

    Dataflow!
    In both VI's the stop terminal of the while loop is controlled by a boolean whose source is ouside of the while loop.  So that loop will either run once, or run forever, depending on the value of the boolean that is calculated before the loop starts and shows up at the tunnel going into the loop.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Checkbox  in a table loop - without using Tableview or Iterator.

    My client doesnt want to use tableview or iterator. We are using basic html to create the page. I know I can accomplish much easily using tableviews...but I am not allowed to use it.
    My requirement is simple. In my layout I loop at my internal table and display the contents. The last field is displayed as a checkbox.
    Ex:
    Name  status flag
    Tom  10         [ ]
    Ted    20        [X]
    Rob    10       [X]
    My loop in the Layout is as below:
    <%
      loop at t_rqdt into l_rqdt.
      if l_rqdt-flag = 'X'.
         l_chk = 'checked'.
      endif.
    %>
    <tr bgcolor="#EFEFEF">
    <td></td>
    <td <%= l_rqdt-name %> </td>
    <td <%= l_rqdt-status %></td>
    <td class=tdstatus width=40% >
    <input type=checkbox name="flag" value="flag" <%= l_chk %> > </td>
      </tr>
    <%
      endloop.
    %>
    When I select couple of rows and mark the flag field checkbox, and SUBMIT at the end, and when I see my internal table t_rqdt field r_rqdt-flag.. I dont see them having value X for the rows I marked the check boxes.
    Can anyone please help me how can I trap the checkboxes marked inside a table loop in my on input processing?
    Thanks
    PK

    Much Thanks Raja! It worked!!
    I declared as below for the form fields and was able to get values.
        DATA:  t_form_fields TYPE tihttpnvp.
        DATA:  l_form_fields TYPE LINE OF tihttpnvp.
        CALL METHOD request->get_form_fields
          CHANGING
            fields = t_form_fields.
    One more before my client asks me to do..
    if I place a button CheckALL and Uncheck All on the layout, how can we check/uncheck all the checkboxes on the client side. Any simple Javascript method available? I know I can pass the itab to on input processing and get the flags set, but if it can be achieved on the client side using a script that would help.
    Please let me know.
    Thanks.

  • CodedUI : How to stop the TestMethod from iterating in a csv file?

    Hello All,
    I have a [TestMethod] which use a csv file. Now this csv file have some 20 rows in that. For one [TestMethod] I need to select one row from that csv, I am able to extract that row. No problem so far. 
    Once my [TestMethod] finished execution with this particular row I need to stop that. It should not take the next row from csv and execute the [TestMethod] with new set of values.
    What should I do to stop the execution after that single iteration?
    Thanks a tonne in advance.
    Thanks and Regards, Sajeev.

    Hi Sajeev,
    You may not be surprised to hear that this question (or something similar) comes up a lot.
    There are a number of basic solutions out there using if statements or loops with only one iteration (this one for example:
    https://social.msdn.microsoft.com/Forums/en-US/7571dbe5-495b-4e47-b012-1c09fbb40a4b/coded-ui-data-driven-test-limiting-the-number-of-iterations?forum=vsautotest)
    You can also ad named ranges to your CSV file and refer to these in your data source configuration instead of the sheet (this post has a lot of detail https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/79c9f86a-a223-4ab6-84af-a7c4baed4951/taking-data-from-single-excel-sheet-for-multiple-test-methods?forum=vstest)
    The drawback of the first type of solution is that all of the "empty" executions for the other iterations will still have results recorded, which makes analysis more difficult. The drawbacks of the second solution are that it is more complicated
    to implement and takes as much work as just creating a new sheet with the single row added (which might be the best option).
    Regardless, I recommend giving both solutions a go if you have time, purely from the point of view of having your own opinion of them.
    Hope this helps,

  • What is the best way to pass a controllin​g signal out of a sub vi or more than one layer of for loop, while the sub vi or for loops are still running?

    I have a vi that runs through two for loops and a while loop, then after a certain number of iterations on the inner while loop it is supposed to pass a trigger to a case stucture to start measurement. I have tried using a local variable attached to a boolean control which in turn is attached to the true case of the case structure involving the measurement sub vi. What is happening is that the boolean control will light on the front panel at the correct # of iterations in the while loop, as if true, but the measurement is not taken, and the boolean control never goes back to false. It remains lit. Am I u
    sing the local variable incorrectly? If so, where am I going wrong.
    Attachments:
    GL_Flicker.vi ‏118 KB
    Take_Measurements.vi ‏147 KB

    Hello planar,
    There are multiple ways to pass control information between loops and VIs and each one has its place. For simple VIs like your example, a local variable will be fine.
    The main reason the subVI is not running is that the case structure is not continuously polling the Boolean control. This is because the case structure is not inside a loop and as such will only read the Boolean value once and execute once. Encasing the case structure and control inside the while loop should solve the issue of the subVI not running.
    You may find the following links of help in creating more robust and advanced VI architectures.
    Application Design Patter
    ns: Master/Slave
    LabVIEW Application Design Patterns
    Keep up to date on the latest PXI news at twitter.com/pxi

  • Why do my loops slow down after many iterations

    My Vi seems to freeze up or slow down after several iterations of the loop. This is an Analog Input Capture VI.
    Attachments:
    Final_Main_VI_with_working_amp.vi ‏456 KB

    First of all, thank you for your contribution. You are right to say that I have no need in changing the AI Config every time that the loop runs. But as this is supposed to be a soft-scope, I need to be able to update the parameters associated with AI Start while the loop is running (e.g. trigger level).
    I have tried to move the AI Config subVI out of both loops but the error as a result is: "No transfer in progress for the specified source."
    I also need a sampling rate of exactly 96kHz. I realize that the laptop clock cannot attain this value. Do you know how I could get exactly 96kHz.
    Attachments:
    Final_Main_VI_with_working_amp.vi ‏498 KB

  • Sudden failure of video in iDVD - sound in 1 byte increments, looping.

    Hi all.
    Suddenly my macbook pro drive has stopped reading video altogether and sound only comes in 'about 1 byte' increments, looping and moving another byte along. What's happened? Can anyone help me? I do use iDVD quite a lot, as I don't have a TV.
    Sr Seraphima

    NTL1991 wrote:
    Well, bad news... The laptop worked flawlessly since Monday, even with the laptop going into and out of sleep probably 4 or 5 times a day. I put the laptop to sleep overnight and it wakes up perfectly in the morning. Now, I had a couple of Windows 7 updates to install, and upon installing them, I rebooted the machine. (Restart, not Turn Off) and its back to the black screen with only the backlight and perfect external VGA output. I've tried keeping the laptop on for about 2 hours or so like before, but it hasn't come back on upon rebooting. I can't find a label on the bottom of the machine with a serial number nor a build date. Is this information available through the ThinkVantage Toolbox? Thanks, Nick
    You can get the model and serial from your bios screen, but the date code is more difficult to obtain. You can approximate it from your warranty in-service date, but that could have been altered if your unit had some shelf life.
    Don't post any serial numbers in the forum, but if you want me to look it up for you, send it to me privately, or you can look it up yourself at lenovo.com
    My advice is to disable all powersaving features and see if the problem persists. You can also try booting from a Linux LiveCD disc and see if the problem is present when running linux, if so, then it's definitely a hardware issue. If this was caused by the cold temperatures of being in your car, then I'd suspect the LCD screen, but the easiest way to track it down would be to substitute a known good one. There is no simple way to pinpoint such an intermintent problem that I'm aware of.
    ThinkPad W-510 i7-820QM(1.73-3.06GHz) Quad Core... ThinkPad T500, T9900, 8gb SSD...FrankNpad T-60p/61p (X9000 2.8ghz) 8gb SSD ips FlexView...ThinkPad T-61p (T9300 2.5ghz) 8gb ram...Thinkpad X-61 Tablet 4gb ram...ThinkPad A-31 (1.9ghz P4 1.5gb ram)

  • Highest speed for a loop in the microprocessor of my CRIO?

    Hello:
    Im trying to develop a control system for an inverter with with my CRIO 9022, the speed of my system is 10 kHz(the switching frequency for the inverter is 10 kHz).
    Im trying to develop the controller using the microprocesor, but I was reading that the highest speed achievable for a loop in the microprocessor is around 1 Khz, is this true?
    If is it, how can I develop a control with a loop of 10 Khz? this speed is only achievable using the FPGA?
    Thanks a lot!
    Regards

    Sorry for dont attach the subVI, but the calculation that I perform inside are not diffcult, the first one is only aritmetic calculations and the second one is a PID (I attach them).
    Maybe I can try to move them to the FPGA, but would be very tedious because I need huge times for compile and if I want to make any change will be very more difficult.
    Do you think that the processor can not carry out these loop a higher speed than 400 Hz?
    Thanks
    Attachments:
    SubVI1.PNG ‏50 KB
    SubVI2(PID).PNG ‏81 KB

  • Why is it that it would take a very long time [if ever] to change or adjust the tempo of a loop in the audio track when i set it to adjust regions to locators? Until now the spinning wheel of death is still very much spinning. thanks for any help.   Is th

    Why is it that it would take a very long time [if ever] to change or adjust the tempo of a loop in the audio track when i set it to adjust regions to locators? Until now the spinning wheel of death is still very much spinning. thanks for any help.
    Is there another way to adjust tempo of loops the faster way, any other technique?

    No clue why the final processes have suddenly started to take so long. Two things I'd try: a) capture from an older tape to see if some problem with the new tape is at fault.  And b) check the health of your RAM and the hard drive.
    The red frame sounds a bit like a glitch we used to have in OnLocation (actually in its predecessor HDV Rack) which was caused by a partial GOP. But that was a product of HDV Rack recording from the live video stream. It turned out that HDV cameras intentionally interrupt the data stream for an instant upon starting to record--specifically to avoid recording a partial GOP to tape. So my gut says that the tape has partial GOPs at the points where you stopped/started recording.

  • How to stop execution in while loop without stopping execution of other loops in the same vi

    HI
    I am quite a novice in Labview.
    I have a problem in my project. I used a while loop inside my vi to build an array of ten values along with other loops. Then I used a stop button to stop manually the while loop. But it seems like the loop doesn't stop in the middle of the array building and so other loops in the vi doesn't work until the while loop finishes building the array and as soon as while loop execution is over, the complete vi stops. But all that I wanted was to build the array using the shift register along with the control to stop building array anytime. And not to stop execution of other structures when the while loop finishes.
    Can anyone help me?
    Rahul

    Hi Rahul,
    Modified ur Vi to work with single button.
    But the subtract case is not in any loop.
    So, once both the loops stop, the subtract case will execute only once. Depending on state of subtaract boolean at that time, corresponding case will be executed and the Vi will stop.
    so think of a logic where u can put this also in a new loop.
    Or you can also incorporate it in one of the two loops and pass the other loop's data to it.
    Let us know how you will proceed in this regard
    I am posting your VI as well a VI with my modifications VI in Labview 7.0 so that Thomas can give his suggestions too
    Plus, always keep a time delay in your while loops.
    Oh sorry, the "arrayinouttestnewfinal.vi" is the modified vi
    Regards
    Dev
    Message Edited by devchander on 01-10-2006 06:15 AM
    Message Edited by devchander on 01-10-2006 06:19 AM
    Attachments:
    arrayinouttestnewfinalnew4.vi ‏59 KB
    arrayinouttestnewfinal.vi ‏63 KB

  • HT200183 If I wanted to include apple loops in the assets of Logic project folders that are part of a tutorial available for download on a paid educational website would that be ok?

    If I wanted to include apple loops in the assets of Logic project folders that are part of a song that follows a tutorial available for download on a paid educational website would that be ok? No one would be paying for the file itself that's part of the membership. I don't want to get into any copyright problems. I understand that they are royalty free and you can include them in your music no problem but the individual loops would be in the audio folder if I saved all the assets to the project file.
    Also, would it be ok to include screen shots I take myself of apple programs in my downloadable content?
    Just trying to figure out exactly how I should go about it to avoid any legal issues.

    Hi
    trainedmind wrote:
    No one would be paying for the file itself that's part of the membership. I don't want to get into any copyright problems.
    My gut reaction is that you may well run into © issues if you re-distribute the original AppleLoops.If your customers are paying for the training, they are also paying for the content you provide, so I feel that you would be re-selling the loops.
    Given that anyone who has a copy of Logic would likely have installed all the loop content, there should be no need to distribute them with the project files. Alternatively, make your own loops.
    CCT

  • Apple loops for garageband pack doesn't show the folder content (loops, files...)  in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.

    apple loops for garageband pack doesn't show the folder content (loops, files...)  in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.

    Thanks Barney, I tried that but all that comes up in Spotlight are the log files that show the file paths! I don't know how Steam works. Are all the files held by Steam on their server perhaps?

Maybe you are looking for

  • Analyze and fix hanging at 100%

    Hi all, I have a project with some 10 hours of footage, including about 5 clips that are about an hour long. I forgot to check "analyze and fix" on import and am trying to do so now. The problem seems to be that whenever the first clip reaches 100% i

  • Issue when i try to use IMMCP3.

    I have changed the existing values of a WBS in CJ40 & made one of the WBS value to ZERO. But when i try to use IMCCP3 the value of ZERO WBS is not getting copied to the Budget but instead it is showing the Previuos values. Before Changing the values

  • Deleting records from the Custom Objects

    Hello all, We want to delete all records from a custom object and as there is no 'Batch Delete' functionality on it, we are thinking of other ways to delete all the records. One of the possibilities is to delete all the records by hand, which will be

  • Downloading additional content appears successful, but nothing has actually installed

    I have been trying to download all the additional content for Logic for the past week. Initially, I began downloading everything together. This resulted in windows popping up saying 'download not successful' or 'unable to complete download'. Subseque

  • How do you get ipad with retina display to display widescreen on a tv

    hi, i just bought an ipad with retina display and an av adapter to go with it, and when i plug them into my tv it only displays a small window, i would like to know if there is a way to make it display widescreen.