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

Similar Messages

  • Insert Procedure For LOOP question

    Hi all,
    I have made a Procedure which basically massages data and loads into into another table and makes a time record aswell. I am practising my good datawarehousing practise (So load table into real DW_table)
    I am using an Explicit Cursor For Loop....
    What i was wondering is if there is some type of SQL%rowcount I can do in order to check that the record where "INSERTED" into dw_client and dw_time; before i create a auit record in another table. I know this is normally done using triggers, but I am testing this for a Datawarehouse and not sure triggers are the best answer. But please correct me if im wrong:
    I basically wanted to put another insert in there, if the inserts actually ran!

    RPuttagunta wrote:
    Why can you not use a merge statement in your code instead of writing a whole procedure for it?
    merge into mehmet_schema.dw_client a
    using
    mehmet_schema.client.....
    If I understand it right, you are checking if there are any records that exists in 'client' and doesn't exist in 'dw_client' table, then, you are inserting. Is that correct?Yes that is correct. Also I am inserting into the dw_time table using the sqeuence values, so i didnt think merge statement would do this!
    aslo i wanted to use this procedure to clean up some of the data, as you can see in my Cursor, again why i havent used a merge
    Edited by: oraCraft on 09-Nov-2010 09:53

  • To view procedure body after got created

    Gurus,
    Please provide me the steps in which we can see the procedure body (DDL) after got created.
    IS this posible through DBMS_SQL package.

    SQL> create procedure myproc
      2  as
      3  begin
      4    null;
      5  end;
      6  /
    Procedure is aangemaakt.
    SQL> select text from user_source where name = 'MYPROC' order by line
      2  /
    TEXT
    procedure myproc
    as
    begin
      null;
    end;
    5 rijen zijn geselecteerd.Regards,
    Rob.

  • I competed updating my ipad2 to ios6. I have 11 apps which has updates I need to perform. But, the procedures of 'agree' and update keep going in a loop and I was not able to update any of the 11 app I need to update. Why the up date procedures keep loopi

    I completed updating my iPad2 to ios6. I hv 11 app which need to be updated and these are flagged. But the updating procedures keep looping itself and I was not able to update any of the 11 app.? Why the update procedures keep looping and how to get out of it.

    Okay - let's cut to the chase...
    If the Menu Bar (File, Edit... Help) shown in my screenshot below is not visible, use CTRL+B to display it. Then click on Help/Check for Updates. If one is available, you will be able to select it at this time.
    Note the item at the bottom of the list; About iTunes. Selecting that will show you which version of iTunes you are using.
    An alternative method to display the Menu Bar is click on the box in the top left of your iTunes window...

  • Hiding store procedure body

    Hi Sir,
    We have written a lot of the stored procedures in the database.
    Is there any way that we can hide the stored procedures body from allowing other people from viewing the source code?
    Please advise.
    Thanks.

    There is the application WRAP to do that. I never used it so I do not know how to use it. Check the documentation or technet.

  • CAN USE COPY COMMAND INSIDE PROCEDURE BODY

    Hi all
    can we use COPY command inside procedure body like this
    CREATE OR REPLACE procedure USER2.PRO1
    Begin
    execute immediate'copy from hr/hr@ERP to USER21/PASS@DB1 append user2.per_images using select * from hr.per_images';
    commit;
    end;
    YOU ADVICE PLEASE

    My advice is to check the manual.
    SQL*Plus COPY command
    http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch12016.htm#i2675035
    SQL manual index
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/index.htm
    PL/SQL manual index
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/index.htm
    CTRL-F on the last two for COPY and it appears not.

  • 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++:
    }

  • Dbma_scheduler job executing procedure that loops through all client schemas in the database rolls back transaction incase of exception

    Hi,
    Needed your inputs on approach to implement a job using dbms_scheduler.
    We have around 2000 schemas. Each schema has a package with 2 procedures.
    The requirement is to create a single job in SYS that would loop through each schema and run the procedures at a specific time ( once a day) and send email notification on success or failure.
    Job script:
    BEGIN
        dbms_scheduler.create_job( job_name=> 'LOAD_EACH_SCHEMA_AUDIT_DATA',
                                   job_type=>'PLSQL_BLOCK',
                                   job_action=>'BEGIN  sys.p_loadaudit;     
                                    END;',
                                   start_date=>systimestamp,
                                   repeat_interval=>'FREQ=MINUTELY;INTERVAL=1',
                                   number_of_arguments=>0,
                                   enabled=> true,
                                   comments=>'Job repeat interval is every 5 mins' );
                                   END;
    Note: for testing purpose i have set repeat interval to minutely.
    Procedure job will be executing:
    Procedure sys.p_loadaudit:
    CREATE OR REPLACE
    PROCEDURE p_loadaudit
    AS
        v_count          NUMBER:= 0;
        lv_error_message VARCHAR2(4000);
        vstmt            VARCHAR2(4000);
    BEGIN
        FOR i IN
        ( SELECT username FROM dba_users WHERE username LIKE 'ABCFIRM%'
        LOOP
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_coa; end;';
            EXECUTE immediate vstmt;
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_am; end;';
            EXECUTE immediate vstmt;
        END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure p_loadaudit: ' || SQLCODE || ' -ERROR- ' || SUBSTR(
        sqlerrm,1,300) || '*' || dbms_utility.format_error_backtrace;
        raise_application_error(-20002,lv_error_message);
    END p_loadaudit;
    Example of one schema: SCHEMA_01
    create or replace
    PACKAGE pkg_audit_info
    AS
    type cursortype
    IS
        ref
        CURSOR;
            PROCEDURE p_load_COA;
            PROCEDURE p_load_AM;
       END pkg_audit_info;
    create or replace
    PACKAGE body pkg_audit_info
    AS
    PROCEDURE p_load_COA
    AS
    BEGIN
    INSERT INTO TABLE1();
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure pkg_audit_info.p_load_COA: ' || SQLCODE
        || ' -ERROR- ' || SUBSTR(SQLERRM,1,300) || '*' || dbms_utility.format_error_backtrace;
        RAISE_application_error(-20002,lv_error_message);
    END p_load_COA;
    PROCEDURE p_load_AM
    AS
    BEGIN
    INSERT INTO TABLE2();
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure pkg_audit_info.p_load_AM: ' || SQLCODE ||
        ' -ERROR- ' || SUBSTR(SQLERRM,1,300) || '*' || dbms_utility.format_error_backtrace;
        RAISE_application_error(-20002,lv_error_message);
    END p_load_AM;
    END pkg_audit_info;
    Table1 and table1 exist in schema_01.
    All 2000 schemas have same package.procedures.
    Due to security reasons i have removed the actual code.
    I was able to execute the job successfully. However, when a schema procedure (SCHEMA_01.pkg_audit_info.p_load_COA) throws an exception, the job fails and all transaction is rolled back.
    Is there a way to loop through each schema and execute the related procedures. Even if exception happens, it should rollback only for that schema and continue the other schemas in the loop?
    Please let me know if there is a better way to achieve this. Is the way i am handling exceptions in the job/procedure correct?
    Thanks

    Hi,
    RAISE_APPLICATION_ERROR will cause the program to exit back to the caller, even if you place it in a block within the loop, so the RAISE or RAISE_APPLICATION_ERROR instruction should be placed in your "pkg_audit_info.p_load_AM" and "pkg_audit_info.p_load_coa" procedures. This way, you can use a block inside the loop and log the error.
    FOR i IN
        ( SELECT username FROM dba_users WHERE username LIKE 'ABCFIRM%'
        LOOP
           BEGIN
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_coa; end;';
            EXECUTE immediate vstmt;
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_am; end;';
            EXECUTE immediate vstmt;
    EXCEPTION
    WHEN OTHERS THEN  
        --> Log the error in a custom log table otherwise you will not know what happened for that schema: don't forget the username
    END;
    END LOOP;

  • Pass REF CURSOR to Procedure and LOOP through it

    Hi All,
    I am trying to figure out how I can pass a ref cursor to a procedure and then loop through it. I have provided an example of what I am attempting to do...just not really sure how to open the ref cursor when it is passed ot the sproc and iterate through it?
    Any info would be greatly appreciated.
    Version:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE     10.2.0.3.0     Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Create Or Replace Package test_ref_pkg
    AS
    function get_ref_curs
    RETURN SYS_REFCURSOR;
    procedure process_ref_curs(
    p_ref_cursor        IN  SYS_REFCURSOR
    END test_ref_pkg;
    Create Or Replace Package Body test_ref_pkg
    AS
    function get_ref_curs
        RETURN SYS_REFCURSOR
    IS
        l_ref_curs      SYS_REFCURSOR;
    BEGIN
        OPEN l_ref_curs FOR
        Select 1 ID, 'Test 1' Name
        From DUAL
        UNION ALL
        Select 2 ID, 'Test 2' Name
        From DUAL;
    END get_ref_curs;
    procedure process_ref_curs(
    p_ref_cursor        IN  SYS_REFCURSOR
    IS
    BEGIN
        ---NOT SURE WHAT TO DO TO ITERATE THROUGH THE REF CURSOR I AM PASSING INTO THIS SPROC?----
    END process_ref_curs;
    END test_ref_pkg;Thanks,
    S
    Edited by: ScarpacciOne on May 28, 2010 9:11 AM

    ---NOT SURE WHAT TO DO TO ITERATE THROUGH THE REF CURSOR I AM PASSING INTO THIS SPROC?----
    -- MAYBE I AM SIMPLE, BUT HOW ABOUT FETCH???
    -- if you start to yell, I will yell too!!!!
    Sybrand Bakker
    Senior Oracle DBA

  • 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.

Maybe you are looking for

  • Why my device not read pdf-files in mail messages?

    Qq why my Nokia device not read pdf-file on mail message?

  • Storage bin match code in LT06

    Hi Expert's, did anyone know why in the LT06 transaction (instead of the LT01) is not possible to use - Source storage section (LTAPA-VLBER) - Source Storage Bin (LTAPA-VLPLA) match code. Thanks. BR. Edited by: Marco Cariello on Apr 22, 2009 8:48 PM

  • ITunes error 3036

    I have had an issue with iTunes for a long time now. On my MacBook Pro, MacBook, or my PC, I open iTunes on click on the Store tab at the top of the window, then I click on Check for Available downloads. I get a pop-up error window that says, "Unable

  • Face recognition software

    can i install lenovo veriface on my laptop g580......the download link for the software in the lenovo center dosenot work correctly,,,,,,http://support.lenovo.com/en_IN/downloads/detail.page?DocID=DS012636.....it downloads the file but the file is co

  • How many of you would purchase the new B.T. Keyboard if was iPhone compat?

    Also, is the USB keyboard compatible? Let Apple know how many of you are interested here, someone will post the appropriate link I assume also.