Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Sudipta Saha
2.1k
85
12.1k
ORA-06550 store procedure error PLS-00306: wrong number
Jan 4 2018 7:50 AM
I have a store procedure like this :
PROCEDURE PRC_ABCD_GETALL (resultset_out OUT TYPES.cursorType)
AS
BEGIN
OPEN
resultset_out FOR SELECT * FROM ABCD;
END PRC_ABCD_GETALL;
and this procedure is in package and the package is like this
create or replace
PACKAGE V4_EVT_PKG_ABCD_GENERAL
AS
PROCEDURE PRC_ABCD_GETALL (resultset_out OUT TYPES.cursorType);
END V4_EVT_PKG_ABCD_GENERAL;
and the oracle data provider was system.data.oracleClient and I used this code
public static IEnumerable<PortalList> GetAll()
{
Database db = DatabaseFactory.CreateData
base();
DbCommand objComm = db.GetStoredProcCommand("p
ackage_nam
e.sp", new object[1]);
var result = new List<PortalList>();
using (IDataReader rdr = db.ExecuteReader(objComm))
{
while (rdr.Read()){
result.Add(Construct(rdr))
;
}
}
return result;
}
and now i found out that system.data.oracleClient is depricated and i want to use Oracle.DataAccess.Client as data provider
I wrote C# code for this but I am facing some errors like wrong number or types of arguments in call to 'PRC_ABCD_GETALL'
in this function PortalListRepository.GetAl
l();
private static IEnumerable<PortalList> GetAll(bool forceDataReload)
{
const string cacheKey = "PortalListService_GetAll"
;
IEnumerable<PortalList> result = null;
if (!forceDataReload)
result = GetFromCache(cacheKey);
if (result == null)
{
result = PortalListRepository.GetAl
l();
AddToCache(cacheKey, result);
}
return result;
}
that I can't solve.
C# code
public static IEnumerable<PortalList> GetAll()
{
string cnn = "connectionstring";
var result = new List<PortalList>();
using (OracleConnection conn = new OracleConnection(cnn))
{
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "PRC_ABCD_GETALL";
cmd.CommandType = CommandType.StoredProcedur
e;
cmd.Parameters.Add("result
set_out", OracleDbType.RefCursor).Di
rection = ParameterDirection.Output;
OracleDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
result.Add(Construct(rdr))
;
}
}
return result;
}
I am very much new to this I don't know how to solve it.Anybody have any idea what am i doing wrong??pls help
Reply
Answers (
2
)
crystal report payslip send the for each employee id gmail
Forgot Password is not sending Email in ASP.NET MVC Identity