unicode parameter with contains() clause in OracleClient

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.
 
G

Guest

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.
 
G

Guest

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. :)
 

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