Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Location
    New York
    Posts
    6

    Question Unanswered: passing collections as arguments while calling a plsql procedure

    Helo All,

    I have two packages Inventory and InventoryImpl. Both of them have the same procedure addBatchPortfolios but with different no.of arguments. The arguments thePortfolioNames and thePortfolioIDs in the package inventory are of type table of Varchar2 and Number respectively. Within the body of this package I am calling addBatchPortfolios from InventoryImpl package via a database link DB1001 which points to the same DB by passing thePortfolioNames and thePortfolioIDs as arguments. These two parameters are defined exactly the same way as in Inventory package below. InventoryImple compiles fine. But when I compile inventory package (the one below..) it errors out saying

    "Wrong number of type of Arguments when calling
    Inventoryimpl.addBatchportfolios(..........)". I am sure

    CREATE OR REPLACE PACKAGE Inventory AS

    TYPE VARCHAR2_Array is TABLE OF VARCHAR2(33);
    TYPE NUMBER_Array is TABLE OF NUMBER(20);

    PROCEDURE addBatchPortfolios(
    theOwnerID IN NUMBER,
    thePortfolioNames IN VARCHAR2_Array,
    thePortfolioIDs IN NUMBER_Array);
    END Inventory;
    /

    CREATE OR REPLACE PACKAGE BODY Inventory AS
    PROCEDURE addBatchPortfolios(
    theOwnerID IN NUMBER,
    thePortfolioNames IN VARCHAR2_Array,
    thePortfolioIDs IN NUMBER_Array)

    AS
    /****Erroring out here***/
    inventoryImpl.addBatchPortfolios@DB1001(Util.getCu rrentUser,theOwnerID, thePortfolioIDs, thePortfolioNames);

    END addBatchPortfolios;
    END Inventory;
    /

    Can someone tell me how to get around this problem? I am thinking it has to do something with reference to the collection objects. But I may be wrong. Please help. Thanks.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: passing collections as arguments while calling a plsql procedure

    Separate types defined in PL/SQL are not considered to be the same type, even if they are identical. In this case, the parameters you pass to inventoryImpl.addBatchPortfolios must be of type inventoryImpl.VARCHAR2_ARRAY etc., not of locally declared types.

  3. #3
    Join Date
    Feb 2003
    Location
    New York
    Posts
    6

    Re: passing collections as arguments while calling a plsql procedure

    Originally posted by andrewst
    Separate types defined in PL/SQL are not considered to be the same type, even if they are identical. In this case, the parameters you pass to inventoryImpl.addBatchPortfolios must be of type inventoryImpl.VARCHAR2_ARRAY etc., not of locally declared types.
    Thanks a lot Tony. I will try that today..

  4. #4
    Join Date
    Feb 2003
    Location
    New York
    Posts
    6

    Re: passing collections as arguments while calling a plsql procedure

    Originally posted by andrewst
    Separate types defined in PL/SQL are not considered to be the same type, even if they are identical. In this case, the parameters you pass to inventoryImpl.addBatchPortfolios must be of type inventoryImpl.VARCHAR2_ARRAY etc., not of locally declared types.
    Hi Tony,

    I just tried this and it works. Thanks much. You saved a lot of time for me..

Posting Permissions

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