Re: Maddening - Creating a stored procedure for use in Crystal Reports
From: TSomers <remoteoracledba_at_hotmail.com>
Date: 10 Mar 2002 11:30:33 -0800
Message-ID: <87a4d936.0203101130.7484aa3b_at_posting.google.com>
return l_cursor;
end;
/
Date: 10 Mar 2002 11:30:33 -0800
Message-ID: <87a4d936.0203101130.7484aa3b_at_posting.google.com>
end;
/
or if you want a ref_cursor type return
create or replace package p_ref_cursor is
'select orders.order_number, lineitems.product, lineitems.qty from orders, lineitems where orders.order_id =lineitems.order_id(+) and orders.order_date >= :start_date' USING start_date;
return l_cursor;
end;
/
This kind of construct will ensure irrespective of how many times this SQL gets called (even with different start_date values) you SQL is parsed once (hard) and executed many times. This is fundamental building block to building scalable applications on Oracle using stored procedures. Also, all production PL/SQL is put in a package not separate functions or procedures that can potentially leave you with a dependancy chain and a real maintenance headache. Received on Sun Mar 10 2002 - 20:30:33 CET