Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Simple Oracle.ManagedDataAccess.Client OracleDataAdapter Fill method not working

$
0
0


Below is a simple Repository class used by my MVC5 Controller to return a result set to my view page. It gets error on theda.Fill(dt) line...
Exception Details: Oracle.ManagedDataAccess.Client.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_SCHEMA_TREE'

The connection is fine and I can call the stored procedure from sqlplus fine.  How can I solve this error?  Thanks.

Here is the stored procedure in oracle 11.2.0.1.0:
create or replace
PACKAGE pak_ui AUTHID CURRENT_USER IS
TYPE return_cur IS REF CURSOR return st_schema_counts_date_range_v%rowtype;
table_not_found EXCEPTION;
no_data_found EXCEPTION;
PRAGMA EXCEPTION_INIT(table_not_found, -942);
g_frequency number;
g_t varchar2(10);
procedure get_schema_tree(schemas OUT return_cur);
END pak_ui;
/
procedure get_schema_tree(schemas OUT return_cur)
is
begin
open schemas for
select * from st_schema_counts_date_range_v;
Exception
when others then
raise;
end get_schema_tree;

Here is the Repository method up to the da.Fill line:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Mvc;
//using System.Data.OracleClient;
using Oracle.ManagedDataAccess.Client;

namespace myProj.Repository
{
public class SchemaTreeRepository
{
private Oracle.ManagedDataAccess.Client.OracleConnection con;
private void connection()
{
string constr = ConfigurationManager.ConnectionStrings["ConnectionOracle"].ToString();
con = new Oracle.ManagedDataAccess.Client.OracleConnection(constr);
}
public List<SchemaTreeModel> GetSchemaTree()
{
connection();
List<SchemaTreeModel> SchemaTreeList = new List<SchemaTreeModel>();
OracleCommand com = new OracleCommand("pak_ui.get_schema_tree", con);
com.CommandType = CommandType.StoredProcedure;
OracleDataAdapter da = new OracleDataAdapter(com);
DataTable dt = new DataTable();
con.Open();
da.Fill(dt);


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>