Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
ORA-06550 store procedure error PLS-00306: wrong number
Sudipta Saha
Jan 4 2018 7:50 AM
139
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
save image into folder and database its path from web servic
Can I add text into a listView of icon ?