Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: testing oracle package
realvert wrote:
> Hi
>
> Currently trying to test my oracle package
> Fleet.SELECT_CARAPPLICATIONBYQUOTE
> which accepts the following SELECT_CARAPPLICATIONBYQUOTE(stringtype,
> Cursortype)
>
> The problem i have is, i use the following syntax to (try to) test it.
> and i know i need to declare a cursor type but i just cannot solve it
> and there for am unable to test my proc.
>
> Any Clues would be greatly appreciated.
>
> regards
>
> Robin
>
> --Test Call --
> BEGIN
> fleet_pkg.SELECT_CARAPPLICATIONBYQUOTE('13456',robinCur);
> END;
>
> ----Package Code as follows ---
> CREATE OR REPLACE PACKAGE FLEET_PKG
> AS
> TYPE car_appCur IS REF CURSOR;
>
> PROCEDURE Select_CarApplicationByQuote(in_quoteref IN VARCHAR2,
> app_cursor IN OUT car_appCur );
>
> PROCEDURE Select_CarApplicationByQuote(in_quoteref IN VARCHAR2,
> app_cursor IN OUT car_appCur ) IS
> BEGIN
> Open app_cursor FOR
>
> SELECT ID,FK_EMPLOYEE_ID, APPLICATION_DATE, ACTIVE, SIGNED_OFF,
> SIGNOFF_DATE, REQUIRED_DATE, MONTHLY_COST, AVCQUOTE_REF
>
> FROM EMPLOYEE_CAR_APPLICATION
> WHERE AVCQUOTE_REF = in_quoteref;
>
> END Select_CarApplicationByQuote;
To test with a REF CURSOR you must call it from within an anonymous block that can receive that REF CURSOR and display its contents by inserting into a table or using DBMS_OUTPUT.
Daniel Morgan Received on Wed Jan 29 2003 - 12:46:23 CST