1
Vote

warning 6005: The data type 'char' is not supported

description

Trying to get the provider working with a 10gR2 database. First try gave me assembly not found errors, my Oracle.DataAccess was very old with version 10.2.0.100. I installed a newer ODAC for 10gR2, and it now is version 2.102.2.20.
 
Using edmgen to generate model from my schema, I got:
D:\projects\EFOracleOdpProvider\scrap>c:edmgen /provider:EFOracleOdpProvider /mo
de:fullgeneration /connectionstring:"Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADD
RESS=(PROTOCOL=TCP)(HOST=********)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(
SERVICE_NAME=*..)));User Id=cptime;Password=*****;" /project:SomeP
rojectName
Microsoft (R) EdmGen version 3.5.0.0
Copyright (C) 2008 Microsoft Corporation. All rights reserved.
 
Loading database information...
warning 6005: The data type 'char' is not supported, the column 'ACTIVE' in table 'dbo.CLIENT' was excluded.
warning 6005: The data type 'char' is not supported, the column 'ACTIVE' in table 'dbo.PROJECT' was excluded.
warning 6005: The data type 'char' is not supported, the column 'ACTIVE' in table 'dbo.TASK' was excluded.
warning 6005: The data type 'char' is not supported, the column 'BILLCODE' in table 'dbo.TIMEENTRY' was excluded.
warning 6005: The data type 'char' is not supported, the column 'ACTIVE' in table 'dbo.WORKER' was excluded.
Writing ssdl file...
Creating conceptual layer from storage layer...
Writing msl file...
Writing csdl file...
Writing object layer file...
Writing views file...
 
Generation Complete -- 0 errors, 5 warnings
 
Looking at one of the problem columns, it was a simple CHAR(1) NULLABLE:
SQL> desc client
Name Null? Type

CLIENT_ID NOT NULL NUMBER
NAME VARCHAR2(40)
ACTIVE CHAR(1)
 
Modifying it to NCHAR allowed it to be processed successfully:
 
SQL> alter table client modify active nchar(1);
 
Table altered.
 
re-run edmgen - one fewer error, no complaints about client.active.
 
Briefly scanning the source for eforacleodpprovider, it appears to be handling "char" appropriately everywhere "varchar2" is handled.
 
Oracle is 10.2.0.1 Enterprise Edition. OS is WIN32: XP SP3. EDMGEN 3.5.30729.1 is being run against empty tables, if that might make any difference.
 
Followup: char(10) caused the same error as char(1); putting a row of data in did not eliminate the warning. The text of the warning appears to come from edmgen. For some reason, edmgen seems to think 'char' is not a supported column datatype in EFOracleOdpProvider.

comments

mstasak wrote Nov 1, 2009 at 11:39 PM

Followup - making the column not null made no difference; debugging edmgen, I found that the method GetEdmType() was never invoked for char(1) columns (in EFOracleOdpProviderManifest.cs). I dumped the primitiveTypes collection to the console and see it does not contain a char entry.
                //this._primitiveTypes = base.GetStoreTypes();
                List<PrimitiveType> primitiveTypes = new List<PrimitiveType>(base.GetStoreTypes());
                foreach (PrimitiveType prim in primitiveTypes) {
                    Console.WriteLine(
                       "Type BuiltInTypeKind: {0}, Type: {1}, Type in Model: {2} ",
                       prim.BuiltInTypeKind, prim.ClrEquivalentType.FullName,
                       prim.FullName);
                }
                //??? if (! primitiveTypes.contains(char) primitiveTypes += char; ???
                this._primitiveTypes = primitiveTypes.AsReadOnly();
Microsoft (R) EdmGen version 3.5.0.0
Copyright (C) 2008 Microsoft Corporation. All rights reserved.

Type BuiltInTypeKind: PrimitiveType, Type: System.Int16, Type in Model: EFOracle.smallint
Type BuiltInTypeKind: PrimitiveType, Type: System.Int32, Type in Model: EFOracle.int
Type BuiltInTypeKind: PrimitiveType, Type: System.Byte[], Type in Model: EFOracle.ref cursor
Type BuiltInTypeKind: PrimitiveType, Type: System.Decimal, Type in Model: EFOracle.number
Type BuiltInTypeKind: PrimitiveType, Type: System.String, Type in Model: EFOracle.nvarchar2
Type BuiltInTypeKind: PrimitiveType, Type: System.String, Type in Model: EFOracle.varchar2
Type BuiltInTypeKind: PrimitiveType, Type: System.String, Type in Model: EFOracle.nclob
Type BuiltInTypeKind: PrimitiveType, Type: System.String, Type in Model: EFOracle.clob
Type BuiltInTypeKind: PrimitiveType, Type: System.Byte[], Type in Model: EFOracle.blob
Type BuiltInTypeKind: PrimitiveType, Type: System.Byte[], Type in Model: EFOracle.raw
Type BuiltInTypeKind: PrimitiveType, Type: System.Byte[], Type in Model: EFOracle.long raw
Type BuiltInTypeKind: PrimitiveType, Type: System.DateTime, Type in Model: EFOracle.date
Type BuiltInTypeKind: PrimitiveType, Type: System.DateTimeOffset, Type in Model: EFOracle.timestamp
Type BuiltInTypeKind: PrimitiveType, Type: System.String, Type in Model: EFOracle.nchar
Type BuiltInTypeKind: PrimitiveType, Type: System.Double, Type in Model: EFOracle.binary_double
Type BuiltInTypeKind: PrimitiveType, Type: System.Single, Type in Model: EFOracle.binary_float
Type BuiltInTypeKind: PrimitiveType, Type: System.Guid, Type in Model: EFOracle.guid

So, trying to find out where PrimitiveTypes come from, I added this to Resources\EFOracleOdpProviderManifest.xml, immediately after the nchar type definition:
  <Type Name="char" PrimitiveTypeKind="String">
      <FacetDescriptions>
          <MaxLength Minimum="1" Maximum="4000" DefaultValue="4000" Constant="false" />
          <Unicode DefaultValue="false" Constant="true" />
          <FixedLength DefaultValue="true" Constant="true" />
      </FacetDescriptions>
  </Type>
This seems to work for me...

wrote Feb 13, 2013 at 10:50 PM