Page 1 of 1

cannot perform '=' operation on CoreLab.Oracle.OracleString and System.String

Posted: Wed 09 Apr 2008 02:22
by benbahrenburg
Hello,

When using the OracleDataTable object I'm running into issues using the DataTable.Select() feature. Is there anyway to implement Select filtering in this fashion? Several third party DataGrids use this method to provide a filtering and sorting method.

When I implement something similar to the following I get the below error.

Code Implemented:

Dim objTab As New OracleDataTable

Dim objCommand = New OracleCommand
objCommand .CommandText = "SELECT PRIVILEGE FROM SESSION_PRIVS"

With objTab
.Connection =MyConnection
.SelectCommand = objCommand
.ReadLobMode = ReadLobMode.DefferedCachedDirect
.FetchAll = True
.ReturnProviderSpecificTypes = True
.CachedUpdates = False
.Active = True
End With

msgbox(
objTab.Select("PRIVILEGE IN ('CREATE PUBLIC SYNONYM','CREATE ANY SYNONYM')").Length
)

Exception Generated:
cannot perform '=' operation on CoreLab.Oracle.OracleString and System.String

Posted: Wed 09 Apr 2008 14:35
by Alexey.mdr
In this particular case you need to use .NET types.
Try setting the .ReturnProviderSpecificTypes property to False.

Posted: Wed 09 Apr 2008 19:23
by benbahrenburg
Thanks that worked. Are there plans to support Provider Specific types?

Posted: Thu 10 Apr 2008 12:11
by Alexey.mdr
We are investigating this problem.
No timeframe is available now, but we will try to solve the
issue as soon as possible.

Posted: Thu 17 Apr 2008 13:54
by Alexey.mdr
We have done a small research concerning the problem.
Unfortunately, the requested functionality could not be implemented.
The code

Code: Select all

objTab.Select("PRIVILEGE IN ('CREATE PUBLIC SYNONYM','CREATE ANY SYNONYM')").Length 
is being parsed by the standard ADO .NET classes that are aware only about “known” types.
OracleString is not a “known” type and CLR throws the exception. ODP has the same problem.
To sum up, the solution stays the same:

Code: Select all

.ReturnProviderSpecificTypes=False