Oracle - SQL Data Source. Wrong number of types of arguments in call to

2 posts, 0 answers
  1. Mohamed
    Mohamed avatar
    1 posts
    Member since:
    Dec 2018

    Posted 20 Dec 2018 Link to this post

     I have a very simple procedure :

    create or replace 
    procedure         get_name(
                     p_cursor out sys_refcursor) is
     begin
     
      open p_cursor for
     
      select NAME 
      from table1;

    end;

    Using SQL Developer the stored procedure returns a list of names, however when trying to use the Telerik Report Designer i receive an (see below for stack trace) error when trying to execute the stored procedure. The only parameter i have is an OUT parameter.

    Any reasons as to why this does not work? Is this a known issue?

    I am using the Oracle.ManagedDataAccess.Client provider.

    System.Data.OracleClient.OracleException (0x80131938): ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'get_name'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

       at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
       at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
       at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals)
       at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
       at System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
       at Telerik.Reporting.Processing.Data.SqlSchemaAdapter.<GetFields>d__1.MoveNext()
       at Telerik.Reporting.Processing.Data.SimpleSchemaAdapter.Fill(SimpleDataModel model)
       at Telerik.Reporting.Processing.Data.SimpleDataProvider`1.GetSchemaCore()
       at Telerik.Reporting.Processing.Data.DataProvider`1.Telerik.Reporting.Processing.Data.IDataProvider.GetSchema()
       at Telerik.Reporting.Data.Design.DataSourceDesignerBase.Telerik.Reporting.Design.Interfaces.IDataSchemaProvider.GetSchema()
       at Telerik.Reporting.Data.Design.DataSourceService.GetSchemaFromContext(Object context)
       at Telerik.Reporting.Design.DataExplorerControl.<>c__DisplayClass2.<RefreshDataSource>b__0()

     

  2. Ivan Hristov
    Admin
    Ivan Hristov avatar
    198 posts

    Posted 28 Dec 2018 Link to this post

    Hello Mohamed,

    Fetching data from a procedure that uses SYS_REFCURSOR works when using Oracle ODP.NET provider. From the provided stack trace I notices that the assembly that provides connection to Oracle is the deprecated System.Data.OracleClient, which should not be used, because its types will be removed in a future version of .NET framework (source: docs.microsoft.com). You can read more here: Should I use System.Data.OracleClient .NET data provider to retrieve data for reports from an Oracle database?

    My suggestion is to install ODP.NET and use it to connect to the Oracle database. In this case the stored procedure should return the result as expected.

    Regards,
    Ivan Hristov
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top