Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Pass a table to a procedure

Pass a table to a procedure

From: Pierluigi Sbaiz <pierluigi.sbaiz_at_elsag.it>
Date: Fri, 21 Sep 2001 10:50:55 +0200
Message-ID: <9oev37$nn2$1@e3k.asi.ansaldo.it>


hi to everyone,

I'm using Oracle 8.1.6 and I know that is possibile to pass an entire single row of a table
to a procedure by using <table_name>%ROWTYPE datatype.

My procedure is (and that's work fine):

PROCEDURE set_creditnote_row ( p_creditnote_row IN CREDITNOTE_ROWS%ROWTYPE )
IS
BEGIN     INSERT INTO creditnote_rows

( transfer_creditnote_id,

          transfer_id,
          creditnote_id,
          processing_session_id,
          item_name,
          item_text,
          quantity,
          charge,
          tax_id,
          tax_rate,
          account )
    VALUES

( p_creditnote_row.transfer_creditnote_id,
p_creditnote_row.transfer_id, p_creditnote_row.creditnote_id, p_creditnote_row.processing_session_id, p_creditnote_row.item_name, p_creditnote_row.item_text, p_creditnote_row.quantity, p_creditnote_row.charge, p_creditnote_row.tax_id, p_creditnote_row.tax_rate, p_creditnote_row.account );

END set_creditnote_row;

What I'd like to know is if there's a way to pass many rows of a table to a procedure?
I'd like to write some like that (but that's wrong):

PROCEDURE set_creditnote_rows ( p_creditnote_rows IN CREDITNOTE_ROWS%TABLETYPE )
IS
BEGIN     LOOP

        p_creditnote_row =  fetch_a_row_from (p_creditnote_rows);
        set_creditnote_row (p_creditnote_row);
    END LOOP END set_creditnote_rows;

Perhaps I need to pass a cursor of the table to my procedure?

Thanks a lot in advance,
SP Received on Fri Sep 21 2001 - 03:50:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US