unicode parameter with contains() clause in OracleClient

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

We are trying to provide keyword searching with the Oracle Text engine using
the 'contains' predicate. However, it does not work when using NVarChar or
DBType.String parameters like so:

IDbConnection conn = database.CreateConnection();
conn.Open();
IDbCommand comm = conn.CreateCommand();
IDbDataParameter param = new OracleParameter();
param.ParameterName = "pFilterValue";
param.DbType = DbType.String;
param.Value = "\"materials\"";
comm.Parameters.Add(param);
comm.CommandText = "select * from tEMailArch where contains(fEmailSubj,
:pFilterValue) > 0";
IDataReader reader = comm.ExecuteReader();
while (reader.Read())
{
Console.WriteLine(reader[0].ToString());
}
conn.Close();

Is there any way to get this to work? We REALLY require the ability to
search on unicode text in the database.
 
Hi Curtis,

Just a suggestion....Have you tried the same thing but using the ODP.net
provider? If you haven't I would strongly suggest doing so. It may handle
the datatypes differently. I have posted a link for you below to the ODP.net
home page and a MSDN reference that compares the two providers.

I hope this helps.
 
Hi Brian,

I have tried the ODP.net stuff and yeah, it does work. However, I'd still
like to be able to have the system.data.oracleclient working, as our system
works with all the other providers (odbc, oledb, sql, odp). It isn't
critical for us, but I found this to be the only way I can find to report a
bug with .net 1.1. (:
 
Back
Top