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

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

Postby benbahrenburg » Wed 09 Apr 2008 02:22

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
benbahrenburg
 
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Postby Alexey.mdr » Wed 09 Apr 2008 14:35

In this particular case you need to use .NET types.
Try setting the .ReturnProviderSpecificTypes property to False.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby benbahrenburg » Wed 09 Apr 2008 19:23

Thanks that worked. Are there plans to support Provider Specific types?
benbahrenburg
 
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Postby Alexey.mdr » Thu 10 Apr 2008 12:11

We are investigating this problem.
No timeframe is available now, but we will try to solve the
issue as soon as possible.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby Alexey.mdr » Thu 17 Apr 2008 13:54

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
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24


Return to dotConnect for Oracle