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