LONG, CLOB UPDATE COLUMN PROBLEM
Posted: Mon 28 Apr 2008 14:29
Hello Everybody,
I'm a software engineer and my company buy UniDirect.NET for migrate one application from Delphi to C#.
The database of application is Oracle and I have a problem with a few columns.
This columns are of type "Long" and I use the type Varchar of Unidirect for update fields firstly. When the application execute the "ExecuteNonQuery" command for update fields only update or insert the first 4000 chars in this kind of columns(Long).
After I try to use the UniBlobs objects (type CLOB) for update this columns, but the result is the same.
I try to use this Uniblobs objects with CLOB columns too, and the result is the same (only updated the first 4000 chars).
In Delphi application, use the DBExpress Compononet for access to database. And use the type ftMemo for manage this kind of columns and works perfectly.
What is the good or best solution?
Thanks for your attention.
I pass you at example of code that initialize at Binary Field:
public override void SetValueTo(TDBConnection pConnection,string pParameterName)
{
UniParameter vParameter;
UniBlob vClob;
byte[] vBuffer;
if (!ReferenceEquals(pConnection.SQLQuery.Parameters, null))
{
//check is value is null
if (IsNull)
vParameter = new UniParameter(pParameterName, DBNull.Value);
else
{
vBuffer=Encoding.UTF8.GetBytes(vValue);
vClob = new UniBlob(pConnection.SQLConnection, UniDbType.Clob);
vClob.Write(vBuffer, 0, vBuffer.Length);
vParameter = new UniParameter(pParameterName, UniDbType.Clob, vBuffer.Length);
vParameter.Value = vClob;
}
pConnection.SQLQuery.Parameters.Add(vParameter);
}
else
throw new Exception("Sql Parameters not assigned");
}
I'm a software engineer and my company buy UniDirect.NET for migrate one application from Delphi to C#.
The database of application is Oracle and I have a problem with a few columns.
This columns are of type "Long" and I use the type Varchar of Unidirect for update fields firstly. When the application execute the "ExecuteNonQuery" command for update fields only update or insert the first 4000 chars in this kind of columns(Long).
After I try to use the UniBlobs objects (type CLOB) for update this columns, but the result is the same.
I try to use this Uniblobs objects with CLOB columns too, and the result is the same (only updated the first 4000 chars).
In Delphi application, use the DBExpress Compononet for access to database. And use the type ftMemo for manage this kind of columns and works perfectly.
What is the good or best solution?
Thanks for your attention.
I pass you at example of code that initialize at Binary Field:
public override void SetValueTo(TDBConnection pConnection,string pParameterName)
{
UniParameter vParameter;
UniBlob vClob;
byte[] vBuffer;
if (!ReferenceEquals(pConnection.SQLQuery.Parameters, null))
{
//check is value is null
if (IsNull)
vParameter = new UniParameter(pParameterName, DBNull.Value);
else
{
vBuffer=Encoding.UTF8.GetBytes(vValue);
vClob = new UniBlob(pConnection.SQLConnection, UniDbType.Clob);
vClob.Write(vBuffer, 0, vBuffer.Length);
vParameter = new UniParameter(pParameterName, UniDbType.Clob, vBuffer.Length);
vParameter.Value = vClob;
}
pConnection.SQLQuery.Parameters.Add(vParameter);
}
else
throw new Exception("Sql Parameters not assigned");
}