DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Executing Packages and Functions

  1. #1
    Join Date
    Dec 2000
    Posts
    2

    Question

    Hello.

    I hope you can help me with what is probably such a simple problem. I am a Notes Developer who needs to create an Oracle stored procedure in order to export information back into Notes.

    Now, my problem is, I have managed to create a package and a function, but now, HOW DO I RUN IT????? The Execute command gives me the error
    PLS-00221: 'GETAANCOST' is not a procedure or is undefined
    (This is the package)

    or

    PLS-00201: identifier 'GETTAXTOTAL' must be declared
    (This is the function)

    Here is the package:
    CREATE OR REPLACE PACKAGE BODY GETAANCOST AS
    FUNCTION GETTAXTOTAL(projectid NUMBER) RETURN NUMBER
    IS
    Taxtotal NUMBER(16);

    BEGIN
    SELECT taxtotal1 + taxtotal2 + taxtotal3 + taxtotal4 + taxtotal5
    INTO TaxTotal
    FROM detail
    WHERE (project_id = projectid) AND (HWCheck = 'T');

    RETURN (TaxTotal);
    END GETTAXTOTAL;

    END GETAANCOST;

    /

    Any help would be GREATLY appreciated!

    Amy

  2. #2
    Join Date
    Dec 2000
    Posts
    138
    while running a proc/func inside a package (public ones)
    u have to run using packagename.procedurename(parameters)

    if its function because it returns a value

    do it like this in sqlplus

    variable x datatype of returned value(size)

    declare
    :x := packagename.functionname(parameter);
    end;
    /
    and then
    to see what it has returned
    print x
    which will return the value.
    hope this helps

  3. #3
    Join Date
    Dec 2000
    Posts
    2
    Thanks for your help. Sorry for the delay, I have been out on vacation.

    Amy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width