Passing morethan 32 KB Data to a Stored Procedure using ODP.Net Provider.

G

GautamKumar

Passing more than 32 KB Data to a Stored Procedure using ODP.Net Provider throws this error to me

" ORA-01460: unimplemented or unreasonable conversion requested"

The same code is working fine with oledb provider type but using ODP.Net it is giving this error if the fILE Size is Greater than 32 KB.

Is there any limitation passing greater than 32 KB.

Please let me know if any body knows ASAP.

Please suggest me if any other specific NewsGroup is there for ODP.Net



FileInfo fi=new FileInfo(@"C:\MyData\Old_Gautam_data\BLR-WS-119\songs\telugu\movies\letsc..txt");

StreamReader sr=new StreamReader(fi.FullName);

string tempbuff=sr.ReadToEnd();

CMD.AddParameter("vOut",null,ParameterDirection.Output,DbType.String,(int)tempbuff.Length);

CMD.AddParameter("vin",tempbuff,ParameterDirection.Input);

This is my sample Procedure which returns clob as out parameter:-->

CREATE OR REPLACE Procedure proctest(nIn Number,vOut out CLOB,vin in CLOB)
is
StrSql Varchar2(3000);
Begin
vOut := vin;
END;


Thanks
Gautam
 
F

Frans Bouma [C# MVP]

GautamKumar said:
Passing more than 32 KB Data to a Stored Procedure using ODP.Net
Provider throws this error to me

" ORA-01460: unimplemented or unreasonable conversion requested"

The same code is working fine with oledb provider type but using
ODP.Net it is giving this error if the fILE Size is Greater than 32
KB.

Is there any limitation passing greater than 32 KB.

Please let me know if any body knows ASAP.

Please suggest me if any other specific NewsGroup is there for ODP.Net



FileInfo fi=new
FileInfo(@"C:\MyData\Old_Gautam_data\BLR-WS-119\songs\telugu\movies\le
tsc.txt");

StreamReader sr=new StreamReader(fi.FullName);

string tempbuff=sr.ReadToEnd();

CMD.AddParameter("vOut",null,ParameterDirection.Output,DbType.String,(
int)tempbuff.Length);

CMD.AddParameter("vin",tempbuff,ParameterDirection.Input);

This is my sample Procedure which returns clob as out parameter:-->

CREATE OR REPLACE Procedure proctest(nIn Number,vOut out CLOB,vin in
CLOB) is
StrSql Varchar2(3000);
Begin
vOut := vin;
END;

You have to specify the type of the parameter for the CLOB input
parameter. You don't do that and ODP.NET then guesses what the type is
based on the value and likely will go for a varchar.

Frans

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
G

GautamKumar

Hai Frans,

Thanks for responding to my post.

As u said I tried mentioning the datatype as CLOB for my in and out
parameters but eventhough I am facing the same problem.

Is there any other case which it will yield this type of error.Please
Suggest me if I am wrong

Thanks

Gautam
 
F

Frans Bouma [C# MVP]

GautamKumar said:
Hai Frans,

Thanks for responding to my post.

As u said I tried mentioning the datatype as CLOB for my in and out
parameters but eventhough I am facing the same problem.

Is there any other case which it will yield this type of error.Please
Suggest me if I am wrong

I could only think of the absense of the datatype for the parameter.
That's how I do it with ODP.NET, (specifying OracleDbType.Clob) and
that works well...

FB
Thanks

Gautam


--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
F

Frans Bouma [C# MVP]

GautamKumar said:
Could u just send me sample code of how ur doing with ODP.Net

That's inside my O/R mapper core, so it's not that easy to give you an
ODP.NET only example. I looked into my code to see if I did anything
special, but all I did was setting the parameter as follows:

/// < ... >
public override IDataParameter CreateParameter(IEntityFieldCore field,
IFieldPersistenceInfo persistenceInfo, ParameterDirection direction,
object valueToSet)
{
object value=base.GetRealValue(valueToSet,
persistenceInfo.TypeConverterToUse, persistenceInfo.ActualDotNetType);
if(value==null)
{
value=System.DBNull.Value;
}
if(value is System.Enum)
{
value=Convert.ToInt32(valueToSet);
}

OracleParameter toReturn = new OracleParameter();
toReturn.ParameterName = CreateParameterName(field.Alias);
toReturn.Direction=direction;
toReturn.IsNullable=persistenceInfo.SourceColumnIsNullable;
toReturn.Precision=persistenceInfo.SourceColumnPrecision;
toReturn.Scale=persistenceInfo.SourceColumnScale;
toReturn.Value=value;
if ((persistenceInfo.SourceColumnDbType == (int)OracleDbType.Clob) ||
(persistenceInfo.SourceColumnDbType == (int)OracleDbType.Blob) ||
(persistenceInfo.SourceColumnDbType == (int)OracleDbType.BFile) ||
(persistenceInfo.SourceColumnDbType == (int)OracleDbType.NClob))
{
toReturn.OracleDbType =
(OracleDbType)persistenceInfo.SourceColumnDbType;
}
else
{
toReturn.DbType =
SelectDbType((OracleDbType)persistenceInfo.SourceColumnDbType,
persistenceInfo.SourceColumnPrecision,
persistenceInfo.SourceColumnScale);
}

return toReturn;
}

THe call to SelectDbType is necessary to convert OracleDbType to
DbType values, but that's about it. As you can see, I don't do anything
special, though I do set the type after the value is set.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top