Search found 4 matches

by Limin Zhang
Tue 28 Aug 2012 17:21
Forum: dotConnect for Oracle
Topic: How can i set the Oracle schemaname at runtime ?
Replies: 16
Views: 9086

Re: How can i set the Oracle schemaname at runtime ?

Thank you for the quick reply.

Currently we are using DotConnect for Oracle 6.x. (Entity Developer 4.2.120) Does it support 'The complete procedure metadata is stored in the mapping source (e.g., in the mapping attributes)'? If not, what the earliest version support this feature? I checked http://www.devart.com/dotconnect/oracle ... story.html and found no information related to this.

As per your request, I list the function I encountered the error.

[Function(Name=@"COM_UTIL.LOG_PROCESS_ERROR")]
public void LogProcessError([Parameter(Name="P_PROCESS_RUN_ID", DbType="NUMBER")] System.Nullable<decimal> P_PROCESS_RUN_ID, [Parameter(Name="P_ERROR_MSG", DbType="VARCHAR2")] string P_ERROR_MSG)
{
IExecuteResult _LogProcessErrorResult = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), P_PROCESS_RUN_ID, P_ERROR_MSG);
}

CREATE OR REPLACE package MyCompany.com_util
as
procedure log_process_error(p_process_run_id in number
, p_error_msg in varchar2
);
end com_util;
/

Thanks
by Limin Zhang
Tue 28 Aug 2012 15:45
Forum: dotConnect for Oracle
Topic: How can i set the Oracle schemaname at runtime ?
Replies: 16
Views: 9086

Re: How can i set the Oracle schemaname at runtime ?

Any update on this issue? Thanks!
by Limin Zhang
Mon 27 Aug 2012 16:50
Forum: dotConnect for Oracle
Topic: How can i set the Oracle schemaname at runtime ?
Replies: 16
Views: 9086

Re: How can i set the Oracle schemaname at runtime ?

Hi,

Thanks to the above posts, I tried the following.

.Clear all classes, methods, and others from model files
.Uncheck 'Preseve schema name'
.Add tables and stored procedures.

The schema name was gone from the attributes of generated table classes. However the generated the generated stored procedures still have schema name.

I removed the schema from the generated file in Visual studio text editor. Then ran my program. I got the error 'ORA-04043: object XXXX does not exist.', in which XXXX is the name of a stored procedure. The stack traces is the following.

[OracleException (0x80004005): ORA-04043: object XXXX does not exist]
Devart.Data.Oracle.a2.b(Int32 A_0) +219
Devart.Data.Oracle.bc.a(String A_0, Int32 A_1) +999
Devart.Data.Oracle.OracleCommand.DescribeProcedure(String name) +986
Devart.Common.DbCommandBase.CreateParameters() +151
Devart.Data.Oracle.OracleCommand.h() +4
Devart.Data.Oracle.OracleCommandBuilder.DeriveParameters(OracleCommand command) +53
Devart.Data.Oracle.Linq.Provider.OracleDataProvider.GetProcParameters(String mappedName, DbParameterCollection& paramNames) +129
Devart.Data.Linq.Mapping.e.a(DataProvider A_0) +316
Devart.Data.Linq.Mapping.e..ctor(an A_0, MethodInfo A_1, DataProvider A_2) +1579
Devart.Data.Linq.Mapping.an.a(DataProvider A_0) +281
Devart.Data.Linq.DataContext.a(Object A_0, MappingSource A_1, Type A_2) +663
Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping) +50

Because the exception happens in the constructor of DataContext, I could not change the schema by 'dataContext.ExecuteCommand("ALTER SESSION SET CURRENT_SCHEMA = \"Schema1\"").'.

Can we set the schema before or in the constructor of DbContext? Or is there any better way to handle multiple schemas?

I am using DotNetConnectForOracle6.x. After checking the latest version, I did not find anything related with this. Please let me know if I miss anything.

Thank you