Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: immdiate help now please please please
Yeah, take a closer look at the code and the error and you'll see that
AB_TEST.AORDER_DETAIL is not referenced in the code. ORDER_DETAIL
is referenced instead. This means that ORDER_DETAIL is a SYNONYM for
that ab_test.aorder_detail. But the table to which the synonym points does
not exist or you have no permissions to access it. PL/SQL tried to resolve
the parameter type and could not find the table, so it stopped processing.
Btw, it's pretty ok to have a synonym that points nowhere. You can't create such synonym directly, but you can create it for existing object with proper permissions, then drop the object or revoke permissions on it and there you have an orphaned synonym.
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "damorgan" <dan.morgan_at_ci.seattle.wa.us> wrote in message news:3C7428E1.FFBAB69E_at_ci.seattle.wa.us...Received on Thu Feb 21 2002 - 05:51:14 CST
> We don't do people's homework for them.
>
> But one of your PLS-00201 issue is either one of spelling or object
> privileges.
>
> Daniel Morgan
>
>
>
> Beau Leo wrote:
>
> > i am doing my homeworks but i got compilation errors so why? would you
> > please fix for me? thanks in advance.
> >
> > 3. Write a function that will calculate the tax on an order. The tax
> > per item depends on the individual product cost. Items costing $1000 or
> > more are taxed at 8% while items costing $999.99 or less are taxed at
> > 6%. (This is the price per item, not the extended price.)
> > · Calculate the tax for the entire order (25 points)
> > · Not Calculate the tax for a single product (15 points)
> >
> > SQL> CREATE OR REPLACE FUNCTION F_TAX (p_invoice_number IN
> > 2 ORDER_DETAIL.INVOICE_NUMBER%TYPE) RETURN NUMBER IS
> > 3 CURSOR c_order_detail (p_invoice_number
> > ORDER_DETAIL.INVOICE_NUMBER%TYPE)
> > 4 IS
> > 5 SELECT *
> > 6 FROM ORDER_DETAIL
> > 7 WHERE invoice_number = p_invoice_number
> > 8 ;
> > 9 total ORDERS.TAX%TYPE;
> > 10 BEGIN
> > 11 total := 0;
> > 12 FOR r_order_detail IN c_order_detail (p_invoice_number) LOOP
> > 13 IF (r_order_detail.UNIT_PRICE > 1000) THEN
> > 14 total := total + ((r_order_detail.UNIT_PRICE * 0.08) *
> > 15 r_order_detail.QUANTITY);
> > 16 ELSE
> > 17 total := total + ((r_order_detail.UNIT_PRICE * 0.06) *
> > 18 r_order_detail.QUANTITY);
> > 19 END IF;
> > 20 END LOOP;
> > 21 RETURN total;
> > 22 EXCEPTION
> > 23 WHEN OTHERS THEN
> > 24 RAISE_APPLICATION_ERROR (-20203, 'Unhandled
> > exception: ' ||
> > 25 SUBSTR (SQLERRM, 1, 200));
> > 26 END F_TAX;
> > 27 /
> >
> > Warning: Function created with compilation errors.
> >
> > SQL> show errors
> > Errors for FUNCTION F_TAX:
> >
> > LINE/COL ERROR
> > --------
> > -----------------------------------------------------------------
> > 0/0 PL/SQL: Compilation unit analysis terminated
> > 2/1 PLS-00201: identifier 'AB_TEST.AORDER_DETAIL' must be declared
> > SQL>
> >
> > --
> > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
>