Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    17

    Unanswered: call function in same package

    hi all,
    I create a package,it contains a function and a procedure,the procedure calls the function to get value,the code as below:

    --procedure declare
    ...
    StringSql := '
    insert into XXXX
    select
    MyFunction(TABLE.FIELD)
    FROM
    TABLE
    ';
    EXECUTE IMMEDIATE StringSql;--error occur here
    ...

    --function declare
    ...

    When I test this procedure, an error of ORA-00904:"MyFunction" invalid identifier occurs.who can tell me the solution?!
    thanks .

  2. #2
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    Hi,

    I think you would need to include the package name in the call to MyFunction...

    select
    MyPackage.MyFunction(TABLE.FIELD)
    FROM
    TABLE

    Hth
    Bill
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

  3. #3
    Join Date
    Sep 2003
    Posts
    17
    thank you!
    I get it!!

Posting Permissions

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