Search found 31 matches

by Anchor
Wed 05 Dec 2012 21:30
Forum: Entity Framework support
Topic: Problems when calling function of a modeled stored procedure
Replies: 2
Views: 4165

Re: Problems when calling function of a modeled stored procedure

I don't know if I found a fix or a work-around but I got my function to work. What I did was edit the EDMX through an XML Editor and looked for the Function definition for the stored procedure. It looks like this...

Code: Select all

       <Function Name="P_GET_USER_CHK_PROD" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" StoreFunctionName="P_GET_USER_CHK_PROD" Schema="COMMON_DEV_OWNER">
          <Parameter Name="I_USER_NAME" Type="VARCHAR2" Mode="In" />
          <Parameter Name="I_USER_PASSWORD" Type="VARCHAR2" Mode="In" />
          <Parameter Name="I_ENFORCE_AUTHORIZATION" Type="decimal" Mode="In" />
          <Parameter Name="I_LOG_ACTIVITY" Type="decimal" Mode="In" />
          <Parameter Name="I_PROD_CODE" Type="VARCHAR2" Mode="In" />
          <Parameter Name="O_RESULT_SET" Type="REF CURSOR" Mode="Out" />
          <Parameter Name="O_IMP_CODE" Type="VARCHAR2" Mode="Out" />
          <Parameter Name="O_MSG_ID" Type="decimal" Mode="Out" />
          <Parameter Name="O_MSG_DESC" Type="VARCHAR2" Mode="Out" />
        </Function>
I changed the Mode attribute from the Parameter element for the O_RESULT_SET from "Out" to "In". I then went into the Model Browser for the EDMX and deleted my previously defined Function Import and created a new Function Import for the modeled stored procedure P_GET_USER_CHK_PROD. I selected the return type as Entity like before and hit "OK".

You will then get a compiler error at your function call (defined from the previous function import) because it now expects a byte[] as a parameter for the O_RESULT_SET instead of an ObjectParameter. Now my call looks like this....

Code: Select all

   byte[] bResultSet = new byte[10000];
   decimal dEnforceAuth = 1;
   decimal dLogActivity = 1;
   var usrTmp = context.sp_Get_User_Chk_Prod(sUserName, sPassword, dEnforceAuth, dLogActivity, sProdCode, bResultSet, O_IMP_CODE, O_MSG_ID, O_MSG_DESC);
That seemed to have solved the problem. I hope this helps someone.
by Anchor
Wed 05 Dec 2012 17:29
Forum: Entity Framework support
Topic: Problems when calling function of a modeled stored procedure
Replies: 2
Views: 4165

Re: Problems when calling function of a modeled stored procedure

BTW, I tried what was suggested here... http://www.devart.com/dotconnect/oracle ... rsors.html

And I still got the same error...

Code: Select all

ORA-06550: line 2, column 3:
PLS-00306: wrong number or types of arguments in call to 'P_GET_USER_CHK_PROD'
ORA-06550: line 2, column 3:
PLS-00306: wrong number or types of arguments in call to 'P_GET_USER_CHK_PROD'
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
by Anchor
Wed 05 Dec 2012 15:04
Forum: Entity Framework support
Topic: Problems when calling function of a modeled stored procedure
Replies: 2
Views: 4165

Problems when calling function of a modeled stored procedure

Hello,

I'm not sure where this questions belongs so I am putting it in this group too.

I am hoping someone can help me. I am trying to execute a function but I am getting an error. This function was created using the Function Import operation which is mapped to a stored procedure that was added to the EDMX from the database. I think the problem is associated to the ref cursor being returned. Just to let you know, I am using EF4 thru VS2010. I am also using the 6.30.185 version of dotConnect for Oracle Professional.

Anyway here is the signature of the stored procedure...

Code: Select all

 procedure p_get_user_chk_prod (
                       i_user_name             in t_ccc_user.user_name%type,
                       i_user_password         in t_ccc_user.user_password%type,
                       i_enforce_authorization in number,
                       i_log_activity          in number,
                       i_prod_code             in t_ccc_product.product_code%type,
                       o_result_set            out ref cursor,
                       o_imp_code              out t_ccc_implementation.imp_code%type,
                       o_msg_id                out t_ccc_message.msg_id%type,
                       o_msg_desc              out t_ccc_message.msg_desc%type) is

This is how I am calling the function in my code....

Code: Select all

private UserDO Validate(string prodCode, string sUserName, string sPassword, out 
                        string impCode, out int nErrCode, out string sErrMsg)
        {
    ObjectParameter o_Err_Code = new ObjectParameter("o_msg_id", -99);
    ObjectParameter o_Err_Msg = new ObjectParameter("o_msg_desc", "None");
    ObjectParameter o_Imp_Code = new ObjectParameter("o_imp_code", "");
    CCCDataEntities context = null;
    UserDO thisUser = null;
    impCode = String.Empty;
    try
    {
        using (CCCDataEntities cxt = new CCCDataEntities())
        {
            //byte[] bResultSet = new byte[10000];

            ObjectParameter o_Result_Set =
                    new ObjectParameter("o_result_set", typeof(byte[]));
            var usrTmp = cxt.sp_Get_User_Chk_Prod(sUserName, sPassword, 1, 1,
                                                  prodCode, o_Result_Set, 
                                                  o_Imp_Code, o_Err_Code, 
                                                  o_Err_Msg);
This used to work when I was using VS2008 and earlier versions of .NET amd dotConnect for Oracle. One thing was different though. Do you see the commented out byte array three lines above the function call? I passed that into the sp_Get_User_Chk_Prod function instead of the ObjectParameter for the Result Set, which is the ref cursor in the stored procedure. However, when I moved this code over to VS2010/EF4 from VS2008/EF1, the compiler comlpained that it expected an ObjectParameter instead of a byte array so I changed it. So, I'm thinking this is the problem but I could be wrong.

Here is the function import information in the EDMX...

Code: Select all

 <FunctionImport Name="sp_Get_User_Chk_Prod" EntitySet="UserDOSet" ReturnType="Collection(CCCDataModel.UserDO)">
            <Parameter Name="I_USER_NAME" Mode="In" Type="String" />
            <Parameter Name="I_USER_PASSWORD" Mode="In" Type="String" />
            <Parameter Name="I_ENFORCE_AUTHORIZATION" Mode="In" Type="Decimal" />
            <Parameter Name="I_LOG_ACTIVITY" Mode="In" Type="Decimal" />
            <Parameter Name="I_PROD_CODE" Mode="In" Type="String" />
            <Parameter Name="O_RESULT_SET" Mode="Out" Type="Binary" />
            <Parameter Name="O_IMP_CODE" Mode="Out" Type="String" />
            <Parameter Name="O_MSG_ID" Mode="Out" Type="Decimal" />
            <Parameter Name="O_MSG_DESC" Mode="Out" Type="String" />
          </FunctionImport>
So when I run my program and exception is thrown. Here is the error I am seeing...

Code: Select all

ORA-06550: line 2, column 3:
PLS-00306: wrong number or types of arguments in call to 'P_GET_USER_CHK_PROD'
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
Here is the stack trace.

Code: Select all

   at Devart.Data.Oracle.av.b(Int32 A_0)
   at Devart.Data.Oracle.ax.d(Int32 A_0)
   at Devart.Data.Oracle.ax.a(Int32 A_0, bg A_1)
   at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at Devart.Data.Oracle.Entity.e.a(CommandBehavior A_0)
   at Devart.Common.Entity.ak.b(CommandBehavior A_0)
   at Devart.Data.Oracle.Entity.e.b(CommandBehavior A_0)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
Do you see anything that is wrong? Do you think it is a problem with how I am passing in the O_RESULT_SET into the function as an ObjectParameter? Any help you could give would be greatly appreaciated.

Thanks,
Joe
by Anchor
Wed 14 Dec 2011 19:29
Forum: dotConnect for Oracle
Topic: Do license files expire at all?
Replies: 1
Views: 869

Do license files expire at all?

I am using doConnect for Oracle v6.3 and I would just like to know if the license file expires after a certain amount of time. Does this happen? If so, how long does the license files last?

Also, will a license file from a previous version of dotConnect for Oracle (say v5.1) work with v6.3 of the software? I doubt it but thought I would ask anyway.

Thanks,
Joe
by Anchor
Tue 04 Oct 2011 15:51
Forum: dotConnect for Oracle
Topic: Two apps, same web site, different versions of dotConnect
Replies: 3
Views: 1017

Thank you for the information.

I am leaning towards options #1. Therefore, do I copy the just DLLs from the C:\Program Files\Devart\dotConnect\Oracle folder or are there more DLLs? (It seems like I don't need all of them.)

For instance, I see in the folder C:\Program Files\Devart\dotConnect\Oracle\Entity\EF4 the DLL Devart.Data.Oracle.Entity.dll. I am assuming I need this as well. Is this correct? (BTW, I am using VS 2010 - .NET 4.0 - EF v4)

Are there any other DLLs I am missing?
by Anchor
Fri 23 Sep 2011 14:21
Forum: dotConnect for Oracle
Topic: Two apps, same web site, different versions of dotConnect
Replies: 3
Views: 1017

Two apps, same web site, different versions of dotConnect

Hello,

Can someone tell me if this is possible? I want to run two applications on the same web site but each application using a different version of dotConnect for Oracle.

The reason we want to have the apps on the same web site is because we want to reuse the same URL. Therefore, one app is accessed via http://myportal.company.com and the other app use the URL http://myportal.company.com/otherapp.

Is this possible?

Thanks,
Joe
by Anchor
Thu 25 Aug 2011 18:20
Forum: dotConnect for Oracle
Topic: Error in stored procs with EF 4
Replies: 6
Views: 1664

Has there been any luck on this? I think I have a similar problem? I am trying to get an entity back from a stored procedure but I get this error...

"The type of the key field 'USER_ID' is expected to be 'System.Int64', but the value provided is actually of type 'System.String'"

It seems like the my database table does not match up with my entity, like the stored procedure is trying to take data from the Address field in the DB table and stuff it into the UserID field in the entity.

It's gotta be either going from the .NET 3.5 to 4.0 or from devart dotConnect for Oracle 5.1 to 6.3 that is causing the problem.
by Anchor
Tue 02 Aug 2011 04:48
Forum: dotConnect for Oracle
Topic: Problem moving EF Model from VS 2008 to VS 2010
Replies: 1
Views: 888

Problem moving EF Model from VS 2008 to VS 2010

Hello,

Recently I upgraded my project that uses dotConnect for Oracle to model a DB schema from VS 2008 to VS 2010. Things seemed to be going fine until I tried to call a modeled stored procedure that returns an entity. When I do I get the following error...

"The type of the key field is expected to be 'System.Int64', but the value provided is actually of type 'System.String'."

The field in question is a "USER_ID" field that when modeled (and shown in the Mapping Table in VS 2010) is defined as an Int64 and models a column in the DB that is a NUMBER(15).

My DLL used dotConnect for Oravle and the Entity Framework and was built using VS 2008. And it still works fine in VS 2008 but after moving it to VS 2010 I get the above error.

Can someone please tell me what could be causing the problem?

Thanks,
Joe
by Anchor
Tue 27 Apr 2010 19:46
Forum: dotConnect for Oracle
Topic: Visual Studio 2010 Beta 2
Replies: 9
Views: 2149

I know. I kicking up an old, old thread but....

We are going to be using the 5.60 version of dotConnect for Oracle so we can develop an application using VS 2010 and Oracle 11g. We already have a license for dotConnect for Oracle 5.20. Do we need to get a new license for version 5.60?

Also, is there a license file that comes with a purchased version of dotConnect or is licensing done another way?

Thanks!
by Anchor
Wed 27 Jan 2010 16:35
Forum: dotConnect for Oracle
Topic: Visual Studio 2010 Beta 2
Replies: 9
Views: 2149

Thanks for the reply.

One other thing. After looking through your website, I noticed there are two choices to go with when using dotConnect for Oracle. You can either use the E.F. or the Linq to Oracle. I see how your site recommends Linq to Oracle for certain situations. However, I thought Microsoft was supporting Linq to Entities but all other "Linq to"s where not being supported any longer.

Is this true?
by Anchor
Tue 26 Jan 2010 15:04
Forum: dotConnect for Oracle
Topic: Visual Studio 2010 Beta 2
Replies: 9
Views: 2149

I will be working on a project that requires using Oracle 11g and possibly using Visual Studio 2010 as well. Since you state that dotConnect for Oracle will work with VS 2010 Beta 2, does this also mean that the latest version of dotConnect for Oracle will work with .NET 4.0 Beta2? Does compatibility with one mean likewise with the other?

Thanks!
by Anchor
Wed 24 Jun 2009 13:16
Forum: dotConnect for Oracle
Topic: Function Import missing from ObjectContext
Replies: 9
Views: 7346

Yes. A co-worker here downloaded it and I was surprise to see it that it worked and not Microsoft's EDM IDE. (I guess I shouldn't have been surprise. ;-) )

I might use your Entity Developer in the future given that Microsoft's next release might not be for a while. However, what do I do if I have a EDM developed using Microsoft's IDE? Will your Entity Developer work with a Microsoft .edmx file?
by Anchor
Tue 23 Jun 2009 15:08
Forum: dotConnect for Oracle
Topic: Function Import missing from ObjectContext
Replies: 9
Views: 7346

I know I am a little late of this topic but I just wanted to comfirm something.

When you say "Microsoft supports Function Imports only for Stored Procedures returning result set" you mean the Visual Studio IDE/Entity Framework does not support "function imports" returning nothing or scalar types, only Entities. So even though VS 2008 allows you to select "None" or "Scalar Type" for a return type when creating a function import, the entity framework does not support it. Correct?
by Anchor
Tue 19 May 2009 19:01
Forum: dotConnect for Oracle
Topic: Not Specifying the Schema Name
Replies: 9
Views: 2485

I tried out these suggestions and they all worked out great! Thanks for the help!
by Anchor
Mon 18 May 2009 17:18
Forum: dotConnect for Oracle
Topic: Not Specifying the Schema Name
Replies: 9
Views: 2485

For example, I have a view that is defined like this....


SELECT
V_529_COLUMN_COMMENTS.COLUMN_NAME AS COLUMN_NAME,
V_529_COLUMN_COMMENTS.COMMENTS AS COMMENTS,
V_529_COLUMN_COMMENTS.TABLE_NAME AS TABLE_NAME
FROM COMMON_OWNER.V_529_COLUMN_COMMENTS V_529_COLUMN_COMMENTS



...and now I have it defined like this....


SELECT
V_529_COLUMN_COMMENTS.COLUMN_NAME AS COLUMN_NAME,
V_529_COLUMN_COMMENTS.COMMENTS AS COMMENTS,
V_529_COLUMN_COMMENTS.TABLE_NAME AS TABLE_NAME
FROM V_529_COLUMN_COMMENTS V_529_COLUMN_COMMENTS


Is this correct?