Home » SQL & PL/SQL » SQL & PL/SQL » Orackle Package
Orackle Package [message #37553] Thu, 14 February 2002 00:42 Go to next message
roy tilakraj
Messages: 2
Registered: February 2002
Junior Member
AS
PROCEDURE RestrictionsByCountryID(intCountryID IN Country_restricted_item_cat.country_id%type,
ItemID OUT typeItemID,
ItemName OUT typeItemName
)
IS
CURSOR Cursor_Restriction IS
SELECT CRIC.item_m_cat_id CATID , IMC.ItemMainCatName CATNAME
FROM country_restricted_item_cat CRIC , item_main_category IMC
WHERE CRIC.Country_Id = intCountryID
AND CRIC.item_m_cat_id(+) = IMC.ItemMainCatId
Order By country_id;

intCount NUMBER DEFAULT 1;

BEGIN
FOR Cursor_SingleRestriction IN Cursor_Restriction
LOOP
ItemID(intCount) := Cursor_SingleRestriction.CATID;
ItemName(intCount) := Cursor_SingleRestriction.CATNAME;
intCount := intCount + 1;
END LOOP;

END;

END;

I HAVE THE ABOVE PROCEDURE IN ONE OF THE PACKAGES AND WHEN I TRIED TO CALL IT FROM VB,IT GIVES THE FOLLOWING ERROR
"[[Microsoft]][[ODBC driver for Oracle]][[Oracle]]ORA-06513: PL/SQL: index for PL/SQL table out of range for host language array
ORA-06512: at line 1"
It works fin in SQL PLUS prompt

What is wrong with this ?
Re: Orackle Package [message #37557 is a reply to message #37553] Thu, 14 February 2002 01:07 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
check the arraysize in VB.
=================
ORA-06513 PL/SQL: index for PL/SQL table out of range for host language array

Cause: An attempt was made to copy a PL/SQL table to a host language array, but an index in the table is either less than one or greater than the maximum size of the host language array. When copying PL/SQL tables to host language arrays, the table entry at index 1 is placed in the first element of the array, the entry at index 2 is placed in the second element of the array, and so on. If a table entry was not assigned, then the corresponding element in the host language array is set to NULL.
Action: Increase the size of the host language arrays or decrease the size of the PL/SQL table. Also make sure that you do not use index values less than 1.
Previous Topic: database trigger to restrict deleting
Next Topic: Re: ORA-00937: not a single-group group function
Goto Forum:
  


Current Time: Wed Apr 24 18:52:01 CDT 2024