By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,203 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,203 IT Pros & Developers. It's quick & easy.

Array in VB.NET

P: 1
The following is my code to get the CLOB from oracle stored procedure.
If I say For I = 0 to 399 it gets the param6 value and executes the reader
And then I have one more For I = 0 to 399 its gets the param6 value and puts it in stclob string. Instead of me specifying the 399 is there a way to get the data dynamically? If I do second For loop For I = 0 to param6.arraybindsize.getupperbound(0) it iterates 50 items and spits the error as A first chance exception of type 'System.IndexOutOfRangeException' occurred in mscorlib.dll. Please your help is important.
I am using vb.net 2005, ODP.NET, and oracle database. My stored procedure takes 5 input parameters and outputs(param6) the CLOB string data.

Dim tRecs(2000) As Int32
Dim i As Long


strSql = "bps.pkgtext.GetFactualGalley"
cm.CommandText = strSql
cm.CommandType = CommandType.StoredProcedure
cm.Parameters.Clear()

Dim param6 As Oracle.DataAccess.Client.OracleParameter = cm.Parameters.Add("P_FACTUALGALLEY", OracleDbType.Varchar2)
param6.CollectionType = OracleCollectionType.PLSQLAssociativeArray
param6.Direction = ParameterDirection.Output
param6.Size = 2000
param6.ArrayBindSize = tRecs


For i = 0 To param6.Size - 1
param6.ArrayBindSize(i) = 2000
Next i


cm.ExecuteReader()

stClob = ""
For i = 0 To param6.ArrayBindSize.GetUpperBound(0)
stClob = stClob & param6.Value(i).ToString
Next i
Apr 24 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.