Calling a package function ret. SYS_REFCURSOR with ED

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Nic77
Posts: 2
Joined: Thu 29 Jul 2010 13:27

Calling a package function ret. SYS_REFCURSOR with ED

Post by Nic77 » Thu 29 Jul 2010 13:58

Hi,

I try to use a function in an oracle package, that takes a CLOB IN parameter and returns a SYS_REFCURSOR.

the spec of the package is as follows:

PACKAGE EUCALYPTUS_PKG_DAL_RCG
is
function SearchMoleculesCSC(sMolfile in clob) return SYS_REFCURSOR;


I already went through the desciption in:


http://www.devart.com/blogs/dotconnect
/?p=5


but the problem is, that the return parameter of the function is inexistant in the C# part..

In entity developer, I created a model from database from the packages function an let ED create the method for the function as well.

Then I let ED generate the cod (.cd, MSL, SSDL and CSDL

The code generated from the packages function is as follows

Code: Select all

CSDL


  
    
      
    
  


MSL


  
    
  


SSDL


  
  
    
  


Generated CS code
//------------------------------------------------------------------------------
// This is auto-generated code.
//------------------------------------------------------------------------------
// This code was generated by Devart Entity Developer tool.
// Code is generated on: 29.07.2010 14:46:36
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------

using System;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using System.ComponentModel;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Data;
using System.Data.Common;

[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata


#endregion

namespace MyModel
{

    #region MyEntities

    /// 
    /// No Metadata Documentation available.
    /// 
    public partial class MyEntities : ObjectContext
    {
        #region Constructors

        /// 
        /// Initialize a new MyEntities object.
        /// 
        public MyEntities() : 
                base(@"metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=Devart.Data.Oracle;provider connection string=""User Id=im;Password=roger;Server=MSRWORK.WORLD;Direct=False;Persist Security Info=True""", "MyEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// 
        /// Initializes a new MyEntities object using the connection string found in the 'MyEntities' section of the application configuration file.
        /// 
        public MyEntities(string connectionString) : 
                base(connectionString, "MyEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// 
        /// Initialize a new MyEntities object.
        /// 
        public MyEntities(EntityConnection connection) : base(connection, "MyEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        #endregion

        #region Partial Methods

        partial void OnContextCreated();

        #endregion

        #region ObjectSet Properties

        #endregion
        #region AddTo Methods

        #endregion

        #region Methods

    
        /// 
        /// There are no comments for Searchmoleculescsc in the schema.
        /// 
        public void Searchmoleculescsc (string SMOLFILE)
        {
            if (this.Connection.State != System.Data.ConnectionState.Open)
              this.Connection.Open();
            System.Data.EntityClient.EntityCommand command = new System.Data.EntityClient.EntityCommand();
            command.CommandType = System.Data.CommandType.StoredProcedure;
            command.CommandText = @"MyEntities.Searchmoleculescsc";
            command.Connection = (System.Data.EntityClient.EntityConnection)this.Connection;
            EntityParameter SMOLFILEParameter = new EntityParameter("SMOLFILE", System.Data.DbType.String);
            if (SMOLFILE != null)
                SMOLFILEParameter.Value = SMOLFILE;
            command.Parameters.Add(SMOLFILEParameter);
            command.ExecuteNonQuery();
        }

        #endregion
    }

    #endregion
}
I would expect the Searchmoleculescsc function to have an ObjectSet return type instead of void.

Any guidance is greatly appreciated.

Thank you

Nic

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 02 Aug 2010 14:29

I have just tried to reproduce the problem using the latest 5.70.152 build of dotConnect for Oracle, but Entity Developer generatd me a correct return type from the set of columns returned by my function.
Could you please upgrade to the latest build of dotConnect for Oracle?
It can be downloaded here (the trial version) or from Registered Users' Area (for users with active subscription only).
Please let me know if the error persists.

Post Reply