CUBRID Lobs


Starting from the 8.4.0 release (http://www.cubrid.org/release_history), CUBRID deprecated the GLO data type, and added support for LOB data types:
These are specific CUBRID data types, and if you need to deal with such data types, you need to learn and use the CUBRID ADO.NET Provider specific extensions.

Here are some basic source code examples to get you start up fast.
Reading BLOB data:

CUBRIDCommand cmd = new CUBRIDCommand(sql, conn);
DbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
CUBRIDBlobbImage = (CUBRIDBlob)reader0;
byte[] bytes = newbyte(int)bImage.BlobLength;
bytes = bImage.getBytes(1, (int)bImage.BlobLength);
//...
}
Updating CLOB data:

string sql = "UPDATE t SET c = ?";
CUBRIDCommandcmd = new CUBRIDCommand(sql, conn);

CUBRIDClobClob = new CUBRIDClob(conn);
str = conn.ConnectionString; //Use the ConnectionString for testing

Clob.setString(1, str);
CUBRIDParameter param = new CUBRIDParameter();
param.ParameterName = "?";
param.CUBRIDDataType = CUBRIDDataType.CCI_U_TYPE_CLOB;
param.Value = Clob;
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();

Trackback '2'

CUBRID ADO.NET Tutorials

Latest AnnouncementsCUBRID ADO.NET Driver Stable 1.0 version has been released Official ADO.NET Driver for CUBRID is now available Installation Instructions [C...

5 days ago

CUBRID ADO.NET Tutorials

Latest AnnouncementsCUBRID ADO.NET Driver Stable 1.0 version has been released Official ADO.NET Driver for CUBRID is now available Installation Instructions [C...

3 months ago

Page info
viewed 209 times
translations en
Author
posted 4 months ago by
CUBRID
Contributors
updated 3 months ago by
View revisions
tagged
Share this article