Monday 10 October 2011

EntityFramework with Oracle; Table Mapping: String > NCLOB

When building your Entities and Relationships using the 'Model First' approach, I found the wizard would automatically map a Scalar Property that you defined as a 'string' to an Oracle datatype of 'NCLOB'.

This was happening because I did not define a 'Max Length' Attribute for the Scalar Property.

To change this: Select the Scalar Property in the Data Model Designer and hit F4 (to view its Properties window) and give it a Max Length. I found that anything up to '2000' would result in the the Oracle Mapping Type being varchar2(X) where X is the Max Length you have defined.

No comments:

Post a Comment