Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2005

Tip: Looking for answers? Try searching our database.

BindSize for Stored Procedure - Limit Setting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
plditallo - 25 Jul 2005 19:01 GMT
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
plditallo@metro-design-dev.com
plditallo - 25 Jul 2005 23:52 GMT
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/microsoft.public.dotnet.framework.adonet/bro
wse_frm/thread/ad5b9771004b1002/ebfe0829d7f3f98f?lnk=st&q=derive+Oracle+column+l
ength&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

       }
               
   }
             
 */

}
plditallo - 27 Jul 2005 22:45 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.