Solved

Error passing Array to PL/SQL Package

Posted on 2003-12-02
4
1,019 Views
Last Modified: 2007-12-19
Trying to pass an array of stings into a PL/SQL package. I get the following error:

Error 3001
Arguments are of the wrong type, out of acceptable range or in conflict with one another.

Package Declaration:
Create or replace WriteSchedByArray
IS
TYPE my_Array IS varray(400) OF VARCHAR2(200);
PROCEDURE MassWriteSched(
                          SchedArray IN my_Array,
                          PercentDone OUT NUMBER
                          );
END WriteSchedByArray;


VB Code::: (ConnO is Open)
  Dim p1 As New ADODB.Parameter
  Dim p2 As New ADODB.Parameter
  Dim cCmd As ADODB.Command
  Dim y As Integer
 y = -1
   Set cCmd = New ADODB.Command
    With cCmd
      .CommandText = "schedule.writeschedbyarray.massWritesched"
      .CommandType = adCmdStoredProc
       .ActiveConnection = ConnO

*** Error is here ***
      Set p1 = .CreateParameter("ary", adArray, adParamInput, 400, arySchd(0))
*** Error is here ***

       Set p2 = .CreateParameter("PercentDone", adInteger, adParamOutput)
       .Parameters.Append p1
       .Parameters.Append p2
       .Execute


Any suggestions?
Bob
0
Comment
Question by:BobMiner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:seazodiac
ID: 9860947
I think Oracle varray index start with 1 , not 0 , different from all other programming languages.

try to change that line to this:
Set p1 = .CreateParameter("ary", adArray, adParamInput, 400, arySchd(1))
0
 

Author Comment

by:BobMiner
ID: 9861385
Thats not it.  Same error.
0
 
LVL 23

Accepted Solution

by:
seazodiac earned 500 total points
ID: 9861467
BobMiner:
I think this problem popped up before in this forum.
I found out that Passing VB array to pl/sql stored procedure does not appear to be supported.
The workaround is pass  a comma-delimited string to pl/sql stored procedure and inside pl/sql stored procedure, of course, you have to have a parsing mechanism to handle it.

you can search this site to find the solution.
0
 

Author Comment

by:BobMiner
ID: 9861849
k, thanks.  Rather annoying but workable.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to recover a database from a user managed backup

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question