BindSize for Stored Procedure - Limit Setting

  • Thread starter Thread starter plditallo
  • Start date Start date
P

plditallo

Hello All--
I am maintaining an enterprise application that has a chunk of
GotDotNet code utilizing the Oracle Client. It appears that when the
OracleParameterCollection returns, it is somehow setting the _size &
BindSize to 2000 -- even though the particular column length is 4000.
Is there a configuration file which might have been set with a 2000
byte limit?

Any advice will be greatly appreciated!

Paula DiTallo
(e-mail address removed)
 
Hello All--
I have more on this topic. It looks like a posting here awhile back
touched on this topic:
http://groups-beta.google.com/group...Oracle+column+length&rnum=13#ebfe0829d7f3f98f

Here is the auto-generated method in Oracle.cs where I would like to
make the change to bump up the default limit.
The commented code represents the possibilities which I would like
to be able to do. For example, I'd like to directly set the size--but
such a possibility
doesn't appear to be available.

Let me know if any of you have found a workaround or know of a
patch/fix for this.

// plditallo - 7/25/2005 QC discovery.
// Note: Problem discovered during QC Testing
// for columns over 2000 in length. The most likely cause is
// in this method.
protected override void DeriveParameters( IDbCommand cmd )
{
if( !( cmd is OracleCommand ) )
throw new ArgumentException( "The command provided is not a
OracleCommand instance.", "cmd" );

OracleCommandBuilder.DeriveParameters( (OracleCommand)cmd );

/*try forcing the expansion of ALL varchar values!

foreach(IDataParameter commandParameter in cmd.Parameters)
{
//Note: This next line isn't really possible as I'd like it to
be, however
// I'll try with the following statement under it.
//if ( commandParameter.Value.GetType() == OracleType.VarChar )

if( commandParameter.DbType.Equals(OracleType.VarChar))
{
//Note: This is unclear to me as to whether I'll
// really expand the length of the column.
// here's what I want to do - but such a direct possiblilty
// isn't available.
// commandParameter.Size = 4000

}

}

*/

}
 
For those coming behind me that may be looking for an immediate
resolution--here's how I solved "around" this issue.

I went back to what I knew would work using:

System.Data.OleDb and System.Data.OracleClient.

I left the GotDotNet portion of the getparameter call populate the
parameters collection. (in the code snippet a single parm: spParm) Then
bound each parameter in the stored procedure on a case by case basis as
follows:

case "A_COLUMN_NAME":

p1 = new OracleParameter(spParm.ParameterName,OracleType.VarChar);
p1.Direction = ParameterDirection.Input;
p1.Value = spParm.Value;

OraCmd.Parameters.Add(p1);

break;

I realize this isn't the ideal solution, but it allows me to keep the
base GotDotNet object alive within the code--while working around a
specific problem.

If any of you come across an answer, or a better workaround, please
leave a post!

Thanks,
--P
 
Back
Top