I have a type declared in an Oracle Database:
CREATE OR REPLACE TYPE t_project_code_changes AS TABLE OF obj_project_code_change;
I map to this type in C# like so
[OracleCustomTypeMapping("DEV_SCHEMA.OBJ_PROJECT_CODE_CHANGE")]
class ProjectCodeChangeFactory : TypeFactoryTemplate<ProjectCodeChangeDTO>
{
//code
}
The above code works without error, however if I remove the schema name 'DEV_SCHEMA' from the attribute, it fails:
[OracleCustomTypeMapping("OBJ_PROJECT_CODE_CHANGE")]
Generates the following error:
Unhandled Exception: System.InvalidOperationException: Custom type mapping for 'ProjectCodeChangeDTO' is not specified or is in valid.
at Oracle.DataAccess.Types.OracleUdt.GetUdtName(String customTypeName, String dataSource)
At some point I will want to ship the code past 'DEV_SCHEMA', but this will result in the code failing.
The schema name comes from the connection string User Id
:
"Data Source=DBNAME;User id=DEV_SCHEMA;Password=pwd;Pooling=False;"
Is there anything I can do onm the Oracle of C# side to help me with this. I.e., somehow:
- Pass the schema name as the attribute parameter
- Define the type in Oracle in a way that I don't need to use the schema
As a further bit of information, this problem presents itself when I use the ODP.NET client version 11.1.0.7. The 11.2 version of the DLL works perfectly without the schema name in the attribute.
Any help would be much appreciated.