Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Exclamation Unanswered: Synonym on package object

    I have overloaded a procedure inside a package. I would like to create a public synonym on the procedure so that calling applications do not need to reference the pkg_name.Proc_name, just a straight call to the synonym which will call to the package.procedure. I was able to create the Synonym, but when I try to execute the object without prefixing it with the package name I get .... Identifier Must Be Declared.

    Anyone know if this is possible, and if so, how......

  2. #2
    Join Date
    Jan 2003
    Location
    Woking
    Posts
    107

    Re: Synonym on package object

    Originally posted by carloa
    I have overloaded a procedure inside a package. I would like to create a public synonym on the procedure so that calling applications do not need to reference the pkg_name.Proc_name, just a straight call to the synonym which will call to the package.procedure. I was able to create the Synonym, but when I try to execute the object without prefixing it with the package name I get .... Identifier Must Be Declared.

    Anyone know if this is possible, and if so, how......
    Hi,
    I dont think creating a synonym for pkg_name.proc_name is possible.
    What you could be doing is create a wrapper procedure.

    Ex:

    CREATE OR REPLACE
    PROCEDURE PRC_WRAPPER AS
    BEGIN
    pkg_name.proc_name
    EXCEPTION WHEN OTHERS THEN RAISE;
    END;
    /

    Hope it Helps.
    nn

  3. #3
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: Synonym on package object

    Originally posted by NoviceNo1
    Hi,
    I dont think creating a synonym for pkg_name.proc_name is possible.
    What you could be doing is create a wrapper procedure.

    Ex:

    CREATE OR REPLACE
    PROCEDURE PRC_WRAPPER AS
    BEGIN
    pkg_name.proc_name
    EXCEPTION WHEN OTHERS THEN RAISE;
    END;
    /

    Hope it Helps.
    Yeah, I thought about a wrapper procedure. But I don't think that will work. Currently the procedure is being called by a web page, and an Oracle Form. Both are expecting different parameter lists. My boss won't approve a modification to either. So I was trying to overload the procedure and take care of handling it on the backend. Thats why I wanted to create a synonym directly t the overloaded procedure in the package. Oh well, guess you can't do that. Thx anyway.

  4. #4
    Join Date
    Jan 2003
    Location
    Woking
    Posts
    107

    Re: Synonym on package object

    Originally posted by carloa
    Yeah, I thought about a wrapper procedure. But I don't think that will work. Currently the procedure is being called by a web page, and an Oracle Form. Both are expecting different parameter lists. My boss won't approve a modification to either. So I was trying to overload the procedure and take care of handling it on the backend. Thats why I wanted to create a synonym directly t the overloaded procedure in the package. Oh well, guess you can't do that. Thx anyway.
    Hi,

    I Guess i missed out on the point (OVER LOADING).
    if the two applications are FORMS and WEB(asp/jsp),
    then u can identify them from the program column
    in the V$session table.

    Hence the alogithm of the same would be

    CREATE OR REPLACE
    PROCEDURE PRC_WRAPPER AS
    BEGIN
    IF (v_program = 'FORMS') then
    pkg_name.proc_name(some set of params);
    else
    pkg_name.proc_name(other set of params);
    end if;
    EXCEPTION WHEN OTHERS THEN RAISE;
    END;
    /


    hope it helps
    nn

Posting Permissions

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