Re: Calling functions...
Date: Thu, 2 Sep 1999 23:22:35 -0400
Message-ID: <1dxj263.10ktfkt8h6s2aN_at_[192.168.0.4]>
<ropru_at_my-deja.com> wrote:
> I would like to now if it's possible to call function (or procedure)
> from another function or porocedure.
>
> Here is the code:
>
> CREATE OR REPLACE function doit
> (v_idnumber payment.idnumber%TYPE)
> RETURN NUMBER
> IS
> v_dexpect VARCHAR2(10);
> v_id NUMBER;
> v_examount NUMBER;
> BEGIN
> SELECT year, idnumber, expectamount
> INTO v_dexpect, v_id, v_examount
> FROM payment
> WHERE idnumber = v_idnumber;
> IF year LIKE '1999/2000' THEN
> foo(v_id, v_examount);
> END IF;
> RETURN 1;
> END doit;
> /
>
> where "foo" is another function. I got error message that:
>
> "PLS-00221: 'FOO' is not a procedure or is undefined"
>
> Foo was created earlier without compliation errors.
You created FOO as a function, but are accessing it as a procedure. Try changing it to something like "dummy := foo(v_id, v_examount);" and see what happens.
-- Kevin Michael Vail | I would rather have a mind opened by wonder kevin_at_vailstar.com | than one closed by belief. -- Gerry SpenceReceived on Fri Sep 03 1999 - 05:22:35 CEST