oracle CLOB 类型字符 读取 的时候为什么 总是报一个错 ORA-00911: 无效字符
相关代码
/// <summary>
/// 返回CLOB数据类型的字符串形式
/// </summary>
/// <param name="sql">查询sql语句</param>
/// <returns>查询到的值</returns>
public string GetSealString(string sql)
{
OracleCommand oraCmd = new OracleCommand();
string ContentBySeal = string.Empty;
try
{
OraOpen();
oraCmd.Connection = ORAConn;
oraCmd.CommandText = sql;
OracleDataReader reader = oraCmd.ExecuteReader();
if (reader.Read())
{
OracleLob myLob = reader.GetOracleLob(0);
StreamReader Sreader = new StreamReader(myLob, Encoding.Unicode);
int actual = 0;
char[] content = new char[6000];
while ((actual = Sreader.Read(content, 0, content.Length)) > 0)
{
ContentBySeal = new string(content, 0, actual);
}
}
}
catch (OracleException oex)
{
throw new ApplicationException(oex.Message);
}
finally
{
OraClose();
}
return ContentBySeal;
}
/// <summary>
/// 获取CLOB字符类型的字符串格式
/// </summary>
/// <returns></returns>
private string GetVise(string BILLNUM,string index)
{
string getCmd = "Select DOCSIGNPIC from ELECSEAL where APPTYPE='MATRECBILL' and SEALGRP like '_"+index+"%' and BILLNUM='" + BILLNUM + "' order by SEALGRP asc;";
string seal = OracleDB.GetSealString(getCmd);
return seal;
}