Loop question

hello,
I have a requirement to make records unique before updating a table. the scenario is as follows.
table - fields A to G ( A, B, C and D are primary )
The data provider changed so they cannot provide an entry for field D, meaning a combination of A B and C may not be unique.
Eg :  A         B      C      D
        X01    032   202 
        X02    032   002 
        X02    032   002 
        X04    032   662 
Records 2 and 3 are not unique, I need to make it unique by incrementing the value of D by 1 for each record before updating the table.
how do I loop within a combination of records in this case to update the field D ?

Hi Suker,
Please check the test program to apply the logic before updating the table.
DATA:
       l_itab TYPE TABLE OF ztest_str11,
       l_str  TYPE ztest_str11, " Structure with field1, field2...
       l_str_temp TYPE ztest_str11,
       l_count  TYPE i VALUE 1.
CLEAR l_str.
l_str-field1  = 12.
l_str-field2  = 11.
l_str-field3  = 1.
l_str-field4  = ''.
l_str-field5  = ''.
APPEND l_str TO l_itab.
CLEAR l_str.
l_str-field1  = 12.
l_str-field2  = 11.
l_str-field3  = 2.
l_str-field4  = ''.
l_str-field5  = ''.
APPEND l_str TO l_itab.
CLEAR l_str.
l_str-field1  = 12.
l_str-field2  = 11.
l_str-field3  = 1.
l_str-field4  = ''.
l_str-field5  = ''.
APPEND l_str TO l_itab.
CLEAR l_str.
l_str-field1  = 12.
l_str-field2  = 11.
l_str-field3  = 1.
l_str-field4  = ''.
l_str-field5  = ''.
APPEND l_str TO l_itab.
CLEAR l_str.
l_str-field1  = 12.
l_str-field2  = 11.
l_str-field3  = 2.
l_str-field4  = ''.
l_str-field5  = ''.
APPEND l_str TO l_itab.
CLEAR l_str.
SORT l_itab BY field1 field2 field3 field4.
LOOP AT l_itab INTO l_str.
  IF l_str_temp <> l_str.
    l_count = 1.
    l_str_temp = l_str.
    l_str-field4 = l_count.
    MODIFY l_itab FROM l_str.
  ELSE.
    l_count = l_count + 1.
    l_str-field4 = l_count.
    MODIFY l_itab FROM l_str.
  ENDIF.
  CLEAR l_str.
ENDLOOP.
After your internal table has the correct data, then update the entries in the table.
Regards,
George

Similar Messages

  • Apple Loops Questions

    1) Where does Logic store user-created loops that I've added to the library?
    2) What is the easiest/best way to convert a regular .aiff or .wav file into an apple loop?
    3) I'm getting a lot of artifacts when I use loops I created--even when the loop is being played back at the same tempo as the original! Is this normal? You'd think that if the original cut was 120 BPM, and I turn it into an Apple loop, and stick it into another project at 120 BPM, there should be no artifacts, right?
    4) Sometimes when I click "add to loop library" Logic won't let me select "looping" as an option. This is after I've already analyzed the cut in Apple Loops Utility. What's up with that?
    Any help, insight or guidance would be appreciated.
    Thank you!

    zgogor wrote:
    1/ apple loops folder / check them ....
    I see folders for all Apple's loops and jam packs, but nothing for my loops.
    Edit: Found them They are at:
    ~/Library/Audio/Apple Loops/User Loops
    Before I was checking the root /Library, which is why I couldn't find them.
    2/ apple loop utility application / check it ...
    I have been using it, but considering the strange behavior I'm getting (see question #3 and #4) I think I might be missing a step or doing it wrong. Right now I open an audio selection in Apple Loops Utility, fill in the tags, mess around with the transient sensitivity, then "save." So why can't I add it as a loop after that?
    3/ no of course.
    Any idea what I might be doing wrong?
    4/ add to appleloop library doesn't mean it is converted, check appleloop utilty first then add them to the Lib
    I did use the loop utility first. I mentioned that in my original post.
    Message was edited by: Zachary Conlyn
    Message was edited by: Zachary Conlyn

  • ABAP Loop Question for next record

    Hello All, I am new to ABAP so please forgive this basic question. The below is a snippet of code I have in a ABAP Proxy.
    Here is a snippet of my code:
    DATA: ls_item    TYPE ZSHOPPING_CART_IN_BBP_PDS_SC_I.
    DATA: i_item     TYPE TABLE OF bbp_pds_sc_item_icu.
    DATA: w_item     TYPE bbp_pds_sc_item_icu.
    LOOP AT input-I_ITEM-item INTO ls_item.
        CLEAR w_item.
        w_item-guid = v_item_guid.
        w_item-parent = v_header_guid.
        w_item-description = ls_item-description.
        w_item-number_int = ls_item-number_int.
        w_item-category = ls_item-category.
        w_item-category_id = ls_item-category_id.
        w_item-product_type = ls_item-product_type.
      APPEND w_item TO i_item.
      ENDLOOP.
    The structure input-I_ITEM-item is an input from a ABAP Proxy. This all works great if I feed in only 1 line item to proxy, but if I send in two line items the result is i_item has line item 1 twice, and I get nothing for line item2. It is almost like the the loop runs twice but the ls_item stays on line 1. I am sure I am missing something simple.

    Here is a snippet of the XML I am sending to ABAP proxy:
    <I_ITEM>
         <item>
              <GUID>00000000000000000000000000055556</GUID>
              <PARENT>00000000000000000000000000055555</PARENT>
              <NUMBER_INT>0000000001</NUMBER_INT>
              <DESCRIPTION>Proxy Test Line</DESCRIPTION>
              <CATEGORY>268CA1C5BB9965449BED8C9B49484999</CATEGORY>
              <CATEGORY_ID>03000</CATEGORY_ID>
              <PRODUCT_TYPE>01</PRODUCT_TYPE>
         </item>
         <item>
              <GUID>00000000000000000000000000055557</GUID>
              <PARENT>00000000000000000000000000055555</PARENT>
              <NUMBER_INT>0000000002</NUMBER_INT>
              <DESCRIPTION>Proxy Test Line  2</DESCRIPTION>
              <CATEGORY>268CA1C5BB9965449BED8C9B49484999</CATEGORY>
              <CATEGORY_ID>03000</CATEGORY_ID>
              <PRODUCT_TYPE>01</PRODUCT_TYPE>
              </item>
    </I_ITEM>

  • Garage Band LOOPS question

    Hi,
    I guess this question can apply to both Logic and GarageBand. When using loops am I locked into the "key" that they appear in? What I mean is this. Let's say I make a song in Amajor in 4/4 time. At that point all my loops appear in the key of A. The problem arises when I want to take the chord progression maybe from I - IV - vi - V - I or something. My question is... can I make those same loops play the appropriate chord for the key signature?
    I hope this makes sense.
    Thank you for any help you can offer.
    B.

    ..I'm not exactly sure what you're asking. But..All the apple loops I've encountered have a series of different notes in one key. You can transpose them, but then not all of the notes in that loop will sound good with the original key. Does that make sense? For example...if you have a loop in A, then play the loop again in D (the IV of A)..it's likely it will contain G natural...a note that occurs in the key of D, but would sound bad in A.
    On top of that..most apple loops are simply melodies. I would recommend layering one of them on top of a bass or piano or synth you'd recorded that would play the chords you want in your song.
    Hope this answers your question.

  • Switching loop question

    Hello everyone!
    I need some clarification of the switching loops. I apologise if my question is too simple, but i really cannot find answer in books, internet. Thanks in advance!
    Please look at the attached topology. This is my test lab for switching loops learning. For simplification purpose IPs, MACs and interface's names were shortened (FF=FF:FF:FF:FF:FF:FF).
    Initial conditions:
    SW-1:
    Cisco Catalyst 3750-V2, 12.2(50)SE5 IPServices, with default, factory config.
    For an unmanaged switch simulation purpose, interfaces 1/1, 1/2, 1/3, 1/4 were configured with switchport host macros and spanning-tree bpdufilter enable command (additional to default factory config).
    Interfaces 1/2 and 1/3 were interconnected with straight through patch cord specifically for creating a switching loop. Just booted up, not learned any MAC-address.
    SW-2:
    Cisco Catalyst 3750-V2, 12.2(50)SE5 IPServices, with default, factory config.
    Just booted up, not learned any MAC-address.
    Both PCs:
    Have a clear ARP-cache.
    Test:
    PC-1 sent ICMP-echo to PC-2. SW-1 received an ARP-request from MAC A (MAC-address of PC-1's NIC) to MAC FF (L2 broadcast as mentioned before) on its 1/1. Because of the initial conditions there is broadcast storm now. MAC A is flapping between 1/2 and 1/3. Next, PC-2 received an ARP-request from MAC A and sent ARP-reply. That ARP-reply arrived at SW-1 and started unicast storm additional to broadcast storm.
    This is clear for me.
    Question:
    What i don't understand is why the SW-1 sends ARP-reply from PC-2 back to the SW-2 (interface 2/1)?
    P.S. apologise for my english. Thanks again!

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    If there's only one or two non-STP switches, in a full mesh, you'll be okay.  Once you have at least three non-STP switches, in a full mesh, you have a loop between them.

  • Infinite Loop Question - should be simple

    Ok I think I have a simple question to ask here. I am attempting to create a program that creates an infinite loop for multiples of two...
    ex: 2, 4, 8, 16, etc...
    The math behind it is simple, x^2 when x = 2. I then want the result of each equation to be squared, and infinitely.
    Here is the code Ive written so far, I think Im close, but I may be way off... any hints or clues as to my next step would be appreciated.
    public class loopytest {
       public static void main (String[] args)
       int x = x^2;
       while (x = 2)
       System.out.println("Value of x is " + x);
    }

    int x = x^2;You have to initialise "x" first.
    You should give it an actual value (e.g. 2) for this case.
    int x = 2;If you want to get the value of x from arguments. (e.g. java YouProgram 2)
    You should change this part of code similar to the follow.
    int x = args[1];But this one hasn't used the Math.pow(), you should read the API and amend it.
    while (x = 2)This one is actually assign x with value 2.
    If you want to compare an int, you should use "A == B", "A.equals(B)" for Object.

  • Cursor For loop question

    Hi,
    I have a cursor in my plsql and I am trying to get the record through a FOR loop. I know that for loop will take care of opening, fetching and closing the cursor implicitly.
    Ex.
    declare
    cursor c1 is
    select * from emp;
    begin
    for l_rec in c1 loop
    end loop;
    My question is i want to check whether the cursor in the for loop is returning any record or not using IF condition.
    where and how i will find that?
    Can anyone help how to do that.
    Rds,
    Nag

    without using boolean variables.Obvious question, WHY?
    If you are so particular..
    SQL> declare
      2   cursor c1 is
      3        select empno, ename, job
      4        from emp
      5        where empno = 7839123;
      6   ex exception;
      7   rec c1%rowtype;
      8  begin
      9   open c1;
    10   fetch c1 into rec;
    11   if c1%notfound then
    12    raise ex;
    13   end if;
    14   loop
    15    dbms_output.put_line(rec.empno||'-->'||rec.ename||'-->'||rec.job);
    16    fetch c1 into rec;
    17    exit when c1%notfound;
    18   end loop;
    19  exception
    20   when ex then
    21    dbms_output.put_line('cur not found');
    22  end;
    23  /
    cur not found
    PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • VERY IMPORTANT FOR LOOP QUESTION

    public class ForTest2 {
         public static void main(String args[]) {
              int i=0, j = 0;
              for (j=0; j < 10; j++) {
                   i++;
                   System.out.println("i is: " + i);
                   System.out.println("j is: " + j);
              System.out.println("Final i is: " + i);
              System.out.println("Final j is: " + j);
    }j ends up being 10. Why? It should only be 9. This is as when j is 10 the for loop fails, so j++ shouldnt happen.

    First, please, please, please stop using all caps. It's extremely annoying.
    Second, don't mark your question as urgent or important. It is 100
    % guaranteed NOT to get you help any faster, and it might just delay you getting help because it's annoying.
    As for your question, you're misunderstanding how the for loop works. j HAS to become 10 for it to end. The loop body executes as long as j < 10. If j didn't become 10, the loop body couldn't terminate, because j<10 would always be true.
    The body is executed, the j++ is executed, then the j<10 is tested.
    int j;
    for (j = 0; j < 10; j++) {
        // body
    // is equivalent to
    int j;
    j = 0;
    while (j < 10) {
        // body
        j++:
    }

  • Procedure Body Loop Question

    I have a procedure that builds an Excel Spreadsheet from a parameter form, depending on the user's selected criteria. To make it easier for testing I am just selecting a range of 3 leases from this form. Each lease may have several entries according to the number of invoices. I am trying to put a total and a blank line between each lease group, but I'm having a problem with how to loop it.
    Below is the code:
    CODE
    PROCEDURE Excel_ReportData ( v_cl_no varchar2,
    v_pr_no varchar2,
    v_ls_date date,
    v_beg_no varchar2,
    v_end_no varchar2 ) is
    cursor c1 ( v_cl_no varchar2,
    v_pr_no varchar2,
    v_ls_date date,
    v_beg_no varchar2,
    v_end_no varchar2 ) is
    select tran_type, lease_no, tran_no, tran_date, dscr, amount, ar_col, ap_col,
    lease_date, cl_no, pr_no, ls_no
    from lease_transactions a, lease_master b
    where b.ls_no = a.lease_no
    and b.cl_no = decode( v_cl_no, null, b.cl_no, v_cl_no )
    and b.pr_no = decode( v_pr_no, null, b.pr_no, v_pr_no )
    and b.lease_date = decode( v_ls_date, null, b.lease_date, v_ls_date )
    and nvl(b.ls_no,0) between nvl(v_beg_no,-100) and nvl(v_end_no,9999999999)
    order by 2, 4;
    cursor c2 ( v_cl_no varchar2,
    v_pr_no varchar2,
    v_ls_date date,
    v_beg_no varchar2,
    v_end_no varchar2 ) is
    select lease_no, nvl(sum(ar_col), 0) ar_sum, nvl(sum(ap_col), 0) ap_sum
    from lease_transactions a, lease_master b
    where b.ls_no = a.lease_no
    and b.cl_no = decode( v_cl_no, null, b.cl_no, v_cl_no )
    and b.pr_no = decode( v_pr_no, null, b.pr_no, v_pr_no )
    and b.lease_date = decode( v_ls_date, null, b.lease_date, v_ls_date )
    and nvl(b.ls_no,0) between nvl(v_beg_no,-100) and nvl(v_end_no,9999999999)
    group by lease_no
    order by 1;
    cr1 c1%rowtype;
    cr2 c2%rowtype;
    v_i number;
    v_no number;
    v_name varchar2 (20) := 'Lease_Trans';
    v_tran_type varchar2 (50);
    v_lease_no varchar2 (20);
    v_tran_no varchar2 (100);
    v_tran_date date;
    v_dscr varchar2 (500);
    v_amount number;
    v_ar_col number;
    v_ap_col number;
    v_lease_date date;
    BEGIN
    Oleexcel.sheetname := 'Sheet1';
    OleExcel.OpenSheet;
    Ole2.release_obj( oleexcel.worksheet );
    OleExcel.LineWeight := 0;
    -- Insert new worksheet in front
    oleexcel.sheetname := v_name;
    Oleexcel.NewSheet;
    Excel_PageSetup( 2, 5 );
    -- Build Header
    v_i := 1;
    ac.counter := 0;
    OleExcel.Set_Cell_ValFullFmt( v_i, ac.nxt, 'T. S. DUDLEY LAND COMPANY, INC.', null, 'Arial', 14, 'Bold', null, OleExcel.cellWhite, false, OleExcel.Left );
    Blank_Cells( v_i, ac.counter+4, 52 );
    v_i := v_i + 1;
    ac.counter := 0;
    OleExcel.Set_Cell_ValFullFmt( v_i, ac.nxt, 'LEASE TRANSACTION REPORT', null, 'Arial', 10, 'Bold', null, OleExcel.cellWhite, false, OleExcel.Left );
    Blank_Cells( v_i, ac.counter+4, 52 );
    v_i := v_i + 1;
    ac.counter := 0;
    OleExcel.Set_Cell_ValFullFmt( v_i, ac.nxt, 'Date', null, 'Arial', 10, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Left );
    OleExcel.Set_Cell_ValFullFmt( v_i, ac.nxt, to_char( sysdate, 'MM/DD/YYYY'), 'MM/DD/YYYY', 'Arial', 10, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Left );
    Blank_Cells( v_i, ac.counter+1, 52 );
    v_i := v_i + 1;
    Blank_Cells( v_i, 1, 52 );
    -- Do Headings
    v_i := v_i + 1;
    OleExcel.LineWeight := 4;
    ac.counter := 0;
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Lease No.', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Transaction Type', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Transaction No.', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Transaction Date', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Transaction Description', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Transaction Amount', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Accounts Receivable', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Accounts Payable', null, 'Arial', 10, 'Bold', null, OleExcel.cellGray, true );
    v_i := 5;
    ac.counter := 0;
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '12' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '16' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '22' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '12' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '40' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '14' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '12' );
    oleexcel.Set_Cell_Property (v_i, ac.nxt, oleexcel.cellWidth, '12' );
    OleExcel.LineWeight := 2;
    OleExcel.Border_Cells( OleExcel.CellAddress( v_i, 1 ) || ':' || OleExcel.CellAddress( v_i, ac.counter ) );
    oleexcel.Set_Cell_Property (v_i, ac.counter, oleexcel.cellHeight, '38.25' );
    v_i := 5;
    open c1 ( v_cl_no, v_pr_no, v_ls_date, v_beg_no, v_end_no );
    open c2 ( v_cl_no, v_pr_no, v_ls_date, v_beg_no, v_end_no );
    loop
    fetch c1 into cr1;
    exit when c1%notfound;
    fetch c2 into cr2;
    exit when c2%notfound;
    v_i := v_i + 1;
    ac.counter := 0;
    -- Output data
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, cr1.lease_no, null, 'Arial', 10, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Left );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, cr1.tran_type, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Left );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, cr1.tran_no, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Left );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, to_char(cr1.tran_date, 'MM/DD/YYYY'), 'MM/DD/YYYY', 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Center );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, cr1.dscr, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Left );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, to_char(cr1.amount), '$###,##0.00', 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Right );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, to_char(cr1.ar_col), '$###,##0.00', 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Right );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, to_char(cr1.ap_col), '$###,##0.00', 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Right );
    oleexcel.Set_Cell_Property (v_i, ac.counter, oleexcel.cellHeight, '15' );
    OleExcel.LineWeight := 2;
    OleExcel.Border_Cells( OleExcel.CellAddress( v_i, 1 ) || ':' || OleExcel.CellAddress( v_i, ac.counter ) );
    Blank_Cells( v_i, ac.counter+1, 52 );
    v_i := v_i + 1;
    ac.counter := 0;
    -- Output data
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, 'Total', null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, true, OleExcel.Left );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, null, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, null, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, null, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, null, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, null, null, 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, to_char(cr2.ar_sum), '$###,##0.00', 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Right );
    oleexcel.Set_Cell_ValFullFmt ( v_i, ac.nxt, to_char(cr2.ap_sum), '$###,##0.00', 'Arial', 9, 'Normal', null, OleExcel.cellWhite, false, OleExcel.Right );
    oleexcel.Set_Cell_Property (v_i, ac.counter, oleexcel.cellHeight, '15' );
    OleExcel.LineWeight := 2;
    OleExcel.Border_Cells( OleExcel.CellAddress( v_i, 1 ) || ':' || OleExcel.CellAddress( v_i, ac.counter ) );
    Blank_Cells( v_i, ac.counter+1, 52 );
    end loop;
    close c1;
    close c2;
    END;
    I've tried several different things, but this is the basic code, which is putting the totals at the end and only showing one lease when it should return 3 leases with multiple lines with the total line after each group.
    I've only been doing Oracle development for a few months so I hope this is an easy question.
    Thanks JLW

    PROCEDURE (some variables passed from form) IS
    cursor c1 is (select statement to get data to populate Excel spreadsheet)
    cursor c2 is (select statement to get totals for Total line in Excel)
    cr1 c1%rowtype;
    cr2 c2%rowtype;
    v_ ...
    Begin
    --Access Last Sheet
    --Insert New WS
    --Build Header
    --Build Column Headings
    *****Here is where I'm having the problem. I am trying to put a total and a blank line between each lease group.
    *****Not sure how to loop this ... sorry I'm a newbie.
    open c1;
    open c2;
    loop
    fetch c1 into cr1;
    exit when c1%notfound;
    fetch c2 into cr2;
    exit when c2%notfound;
    --Output Data from c1 (I need this to be only 1 lease group from c1)
    --Output Data from c2 (total from c2 with a blank line)
    ... and so on until c1-c2 notfound
    end loop
    close c1
    close c2
    end
    Below is an example of the output in Excel:
    ~*Lease No.* TransType Trans No. Trans Date Trans Description Trans Amount Accounts Receivable ~~*Accounts Payable*~
    ~812320 Invoice 681050 7/23/2008 68105 $3,156.55 $3,156.55 $3,156.55~
    ~812320 Check 35058 08/18/2008 County Clerk $17.00 $0.00 -$17.00~
    ~Total $0.00 $0.00~
    ~(BLANK LINE)~
    ~812327 Paid by Other 07/15/2008 $1,260.00 $0.00 -$1,260.00~
    ~812327 Bonus 07/15/2008 $1,260.00 $0.00 $1,260.00~
    ~Total $0.00 $0.00~
    Any help would be greatly appreciated.
    Thanks

  • Apogee ONE ground loop question

    Sorry that this is not directly related to Logic. My question is about why one audio interface has a ground loop issue when another one does not in the exact same setup. Details:
    Previously using an Edirol UA-5 as a USB interface. 1/4" outputs in the back connected directly to a pair of powered monitors. Monitors are plugged into a power strip that connects to a different outlet than my computer. No ground loop hum.
    Recently tried to replace the UA-5 with an Apogee ONE USB interface. Changing nothing about my configuration other than 1.) plugging the ONE's USB cord into the port where the UA-5 was plugged in and 2.) using a splitter on the ONE's stereo 1/8" output to connect it directly to the powered monitors. Total hum and high-pitched whine through the monitors.
    Leaving the ONE in place, I inserted one of those cheap 3 prong to 2 prong adaptors at the wall outlet for the monitors' power strip. Hum and whine disappeared.
    So my question is: what does this tell me about these two interfaces? Which one has the problem? Given that the ONE is more expensive and of supposedly better quality, I would have expected it to be more tolerant of things like ground loops than the UA-5. Or is my understanding wrong? Is there some spec or sensitivity that is desirable but that renders the device susceptible to ground loops that I don't know about?
    I don't know if I should be disappointed or not!

    More info:
    1. When I use a 2-3 prong adaptor on the the power strip that powers the monitors and connect the monitors to the ONE, a power outlet tester plugged into the strip shows a "correct" connection, which means it is grounded correctly.
    2. When I use the 2-3 prong adaptor on the the power strip that powers the monitors and do NOT connect the monitors to the ONE, the power outlet tester plugged into the strip shows an ungrounded connection.
    To my understanding, that's a lot of evidence that the monitors are being grounded through the ONE. Anything else I should try?
    Strangely (to my understanding), when I plug the power strip that powers the monitors into the power strip that powers the computer, I get all the hum and whine again. In addition I get a mid-range-y constant chatter, almost like a fan noise. If I use the 2 to 3 prong adaptor to connect the monitor power strip into the computer power strip, the hum and whine go away, but the mid-range chatter stays. I had thought the hum and whine would not have happened since I think there was only one path to ground. Any thoughts about that?
    Message was edited by: Will Rees

  • Stupid WHILE loop question

    A=0
    While A<B
    BEGIN
          Set B=B+1
         ...statements
    END
    If B had been = to 1 would the loop process through to the END or exit as soon as B was incremented?

    The best way to learn this would be trying by yourself.
    Hint: Based on what you posted (B = 1) you will need to learn the keyword BREAK.
    AMB
    Some guidelines for posting questions...
    AYÚDANOS A AYUDARTE, guía básica de consejos para formular preguntas

  • A simple for loop question

    Hi
    Lets say I have an array with boolean values in it:
    my_array = [ false , false , false ]
    My question is:
    How do you make a function to check, if the value is all
    false, than do this (not only one but all false than trigger a
    function)
    thank you

    The 350Z,
    > Lets say I have an array with boolean values in it:
    > my_array = [ false , false , false ]
    I'm with ya.
    > My question is:
    > How do you make a function to check, if the value is
    > all false, than do this (not only one but all false than
    > trigger a function)
    Your subject line already states the answer. A for loop
    would come in
    handy. :) In your case, you're looking for all three values
    to be false.
    If even a mere one of them is true, the whole result doesn't
    count. Let's
    write a function that returns true if all three are false,
    and returns false
    if any are true.
    function checkWholeArray(arr:Array):Boolean {
    for (var n:Number = 0; n < arr.length; n++) {
    if (arr[n] == true) {
    return false;
    return true;
    To use this function, you could call it and supply your
    array as the
    parameter ...
    checkWholeArray(my_array);
    ... and since that resolves to either true or false, you
    could even use that
    expression in an if statement.
    if (checkWholeArray(my_array)) {
    // do something
    } else {
    // do something else
    The for loop simply steps through each element in the
    passed-in array.
    If the current element is true, then the desired outcome --
    that all
    elements are false -- is a loss, so the function returns
    false and
    immediately stops (the return statement always exits the
    function at that
    point). Otherwise, the for loop finishes, and the function
    returns true.
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Bts2006 r2 loop question (parent/child)

    I need a resultxml that loops over a childrecord and if there is no childrecord there over the parentrecord/
    Can this be done using the mapper or do i need to use XSLT?
    Sourcesample
    <BOMLine>
    <BOMQty>48.0000</BOMQty>
    <ItemId>Item1</ItemId>
    <BOMReference>
    <Qty>23.0000</Qty>
    <Reference>Ref1</Reference>
    </BOMReference>
    <BOMReference>
    <Qty>25.0000</Qty>
    <Reference>ref2</Reference>
    </BOMReference>
    </BOMLine>
    <BOMLine>
    <BOMQty>48.0000</BOMQty>
    <ItemId>Item2</ItemId>
    </BOMLine>
    <BOMLine>
    <BOMQty>24.0000</BOMQty>
    <ItemId>Item3</ItemId>
    <BOMReference>
    <Qty>24.0000</Qty>
    <Reference>ref3</Reference>
    </BOMReference>
    </BOMLine>
    Desired result
    <ResultBOM>
    <Qty>23</Qty>
    <ItemId>Item1</ItemId>
    <Reference>Ref1</Reference>
    </ResultBOM>
    <ResultBOM>
    <Qty>25</Qty>
    <ItemId>Item1</ItemId>
    <Reference>Ref2</Reference>
    </ResultBOM>
    <ResultBOM>
    <Qty>48</Qty>
    <ItemId>Item2</ItemId>
    <Reference></Reference>
    </ResultBOM>
    <ResultBOM>
    <Qty>24</Qty>
    <ItemId>Item3</ItemId>
    <Reference>Ref3</Reference>
    </ResultBOM>
    Kind regards Isabelledc

    If you prefer xslt, I tested below for you and works as you needs:
    <Root>
    <xsl:for-each select="/Root/BOMLine">
    <xsl:variable name="var:itemID" select="ItemId/text()" />
    <xsl:if test="not(BOMReference)">
    <ResultBOM>
    <xsl:variable name="var:qty" select="BOMQty/text()" />
    <Qty>
    <xsl:value-of select="$var:qty" />
    </Qty>
    <ItemId>
    <xsl:value-of select="$var:itemID" />
    </ItemId>
    <Reference/>
    </ResultBOM>
    </xsl:if>
    <xsl:if test="BOMReference">
    <xsl:for-each select="BOMReference">
    <ResultBOM>
    <Qty>
    <xsl:value-of select="Qty/text()" />
    </Qty>
    <ItemId>
    <xsl:value-of select="$var:itemID" />
    </ItemId>
    <Reference>
    <xsl:value-of select="Reference" />
    </Reference>
    </ResultBOM>
    </xsl:for-each>
    </xsl:if>
    </xsl:for-each>
    </Root>
    FYI: I assumed "Root" because your XML above doesn't have a root.
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.

  • Input thread - loop question

    Sorry for all the annoying questions. Just one more answered would be great, I know the problem in this code is my Input class only reads and sends one line to the server and as it isn't in a loop thethread terminates immediately, after one line leaving only the thread that's reading data from the server. I've tried a few loops but nothing seems to work. Can anyone point out what kind of while loop and where i can put it in.
    import java.net.*;
    import java.io.*;
    class Input extends Thread
    private PrintWriter toServer;
    private BufferedReader keyBoard;
    private Socket socket;
    public Input(Socket sock)
    socket = sock;
    public void run()
    keyBoard = new BufferedReader(
    new InputStreamReader (System.in));
    try {
    toServer = new PrintWriter(
    new OutputStreamWriter(
    socket.getOutputStream()),true);
    catch(Exception e) {
    String command ="";
    try {
    command = keyBoard.readLine();
    catch (IOException e) {
    toServer.println(command);
    }

    try
    try {
         command = keyBoard.readLine();
         while (command != null) {
               toServer.println(command);
              command = keyBoard.readLine();
    } catch (IOException e) {
         e.printSTackTrace();
    }

  • Sound looping question

    hello everyone!
    i'm pretty new to using flash (i only need to use it for a uni sound design project) and i'm having some problems.
    what i'd like to do is create a button, and loop sounds in the "up" state of that button. the only problem is, that if i import the sound to the "up" keyframe and choose loop in the properties it keeps looping until the end of time. what i'd like though is it looping just in the event of the mouse being in the buttons' area. what should i do?

    1) create button
    2) doubleclick on the button (edit)
    3) create extra layer for sounds
    4) in this layer, create empty keyframes for all states (UP, OVER, DOWN, HIT);
    5) add the sound to the OVER keyframe in sounds layer, set it to SYNC: Start, Loop
    6) add the sound to the UP keyframe in sounds layer, set it to SYNC: Stop, Loop

  • Multiple timed loop question

    I am currently in the planning stage of a medium sized labview application and I need some help figuring out the best approach as application of this size is still new territory for me.
    I have a daq device monitoring 4 channels, a couple of motor controls, and the goal is to update the GUI with the information from the 4 channels, and also calculations performed on that information, all while letting the user control the motors in real time. All actions and data will be logged and written to disc preferrably in real time.
    The plan so far is of course to beak them up into subVI's, with the motor controls in 1 subVI, and the monitoring in 1 subVI, calculation performed on the data in another subVI, and a main driver VI that controls the timing of the loops and updates the GUI.
    I initially thought about using action engines for the data acquisitions, but I realized that using action engines might "freeze" the program when data acquisition is happening, and the user will lose control of the motors. Another approach is the producer/consumer pattern, where the incoming data from the DAQ is consumed to perform calculations and the data logged onto disc. This is the approach that I think I will take, but how do I implement the real time motor controls into this pattern?
    The idea that I have is to have a main program state machine that handles all user input, and parallel loops that implement the producer/consumer model, and another parallel loop that will update the motor information when it is changing. Is this a suitable approach for an application of this type? Would a queue help the timing aspect in between the parallel loops? As calculations must be performed on each iteration and updated to the gui before the next data point is acquired, at the speed of 100hz. I am having trouble visualizing how to implement multiple loops in separate subVI's and synchronizing the data in between each other.
    Please advice if there are other better patterns/approach for something like this.
    Thank you.

    Producer consumer would fit here well. You will also need to use a state machine system for flow control. I would also look into event structures and firing events. If you put all of this together it will make a nice simple upgradable program. This is a system that I helped somone else start.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Try This System.zip ‏84 KB

Maybe you are looking for

  • How can I change my iCloud account without my original password?

    How can I Change my iCloud account without having access to my original password?

  • How to add control statement in Ant build file

    I don't know where to publish this question. if here is not the right place, can you tell me? I want to use Ant to run a java program. but the program can only deal with one file each time. So, I want to get all files' name and run it in a "while" or

  • "The disk could not be read from or written to"? Help!

    I was recently trying to update my ipod (5th gen. video) and sync it with my new music I downloaded, however the new songs would not sync and this error message came up: Attempting to compy to the disk "ipod" failed. The disk could not be read from o

  • Kernel panick

    For last few days, I am getting kernel panics few times a day. I have checked nothing has been updated in last few days. I am running Mavericks 10.9.4 on Macbook pro July 2011 edition. Can someone please help me with some pointers before I take it to

  • Transferring ipod and itunes to new computer

    I just got a new computer and downloaded itunes. When I plugged my ipod in, my library showed up but the screen was gray and I couldn't select anything. Any suggestions on how to transfer?