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 this type to C # like this:
[OracleCustomTypeMapping("DEV_SCHEMA.OBJ_PROJECT_CODE_CHANGE")] class ProjectCodeChangeFactory : TypeFactoryTemplate<ProjectCodeChangeDTO> { //code }
The above code works without errors, however, if I remove the schema name "DEV_SCHEMA" from the attribute, this will not work:
[OracleCustomTypeMapping("OBJ_PROJECT_CODE_CHANGE")]
It raises the following error:
Unhandled exception: System.InvalidOperationException: Custom type mapping for 'ProjectCodeChangeDTO' not specified or valid.
in Oracle.DataAccess.Types.OracleUdt.GetUdtName (String customTypeName, String dataSource)
At some point I will want to send the code for "DEV_SCHEMA", but this will lead to a code failure.
The schema name comes from the User Id connection string:
"Data Source=DBNAME;User id=DEV_SCHEMA;Password=pwd;Pooling=False;"
Is there anything I can do with Oracle on the C # side to help me with this. Ie, somehow:
- Pass the schema name as an attribute parameter
- Define a type in Oracle so that I don't need to use a schema
As additional information, this problem occurs when I use the client version of ODP.NET version 11.1.0.7. Version 11.2 of the DLL works fine without the schema name in the attribute.
Any help would be greatly appreciated.