Hi All,I am new gem for developing MVC application's. I created an MVC 4 application using VS 2013.
In oracle I have one table as SSO having two columns as SSOID and SSONUM.
I created one Procedure to get data on the basis of requested ID.
CREATE OR REPLACE PROCEDURE GETSSODETAILS (
cursorParameter OUT SYS_REFCURSOR,
p_ssoid IN SSO.SSOID%TYPE
)
as
SSONum SSO.SSOnum%TYPE;
SSOid SSO.SSOid%TYPE;
cursor CursorParam is
SELECT * FROM SSO WHERE SSOID=p_ssoid;
BEGIN
OPEN cursorParam;
if cursorParam%ISOPEN THEN
FETch cursorParam into SSONum, SSOid;
dbms_output.put_LINE('SSONum = ' || SSONum || ' SSOid = ' || SSOid);
END IF;
END;
Now I added ADO .Net ENtity Model Framework in my project to work with Db Context.
After that In HomeController.cs class i have below code :
public ActionResult Index()
{
Entities entities = new Entities();
var output = entities.GETSSODETAILS(1);
return View(output);
}
Which makes a call to my Model1.context.cs and there I have code as below
public virtual ObjectResult<SSODetails> GETSSODETAILS( Nullable<decimal> p_SSOID)
{
var p_SSOIDParameter = p_SSOID.HasValue ?
new ObjectParameter("P_SSOID", p_SSOID) :
new ObjectParameter("P_SSOID", typeof(decimal));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SSODetails>("GETSSODETAILS", p_SSOIDParameter);
}
When I am running this code, It gives me error as below
ORA-06550: line 1, column 8:
PLS-00306: wrong number or types of arguments in call to 'GETSSODETAILS'
ORA-06550: line 1, column 8:
PL/SQL: Statement ignored
Please let me know Am I doing something wrong..?? I believe I have to pass one more parameter in my Model1.context.cs function while calling ExecuteFunction() method. and that should be output parameter. I am not able to declare output parameter which
works with CURSOR type in Oracle.
Spent my last four days on this. Would be great if anyone can help me asap. I have deadlines to kick off my project.
I will be lucky if someone can send dummy project for the same requirements. VS 2013, using Oracle Database with the help of ODP .Net using ENtityFramework, Calling procedure.
I will be lucky if someone can send dummy project for the same requirements. VS 2013, using Oracle Database with the help of ODP .Net using ENtityFramework, Calling procedure
As per your case, the following link which may guide you to fix this issue
1.
Click here to get complete video tutorial with screenshot explanation of MVC ODP.net project using entity framework
2.
Click here to refer this forum link which had discussion about Oracle ODP.Net With Entity Framework 6 - Entity framework database compatible provider
None
0 Points
6 Posts
MVC Application with Oracle DB
Mar 18, 2015 01:18 PM|virendersasmal|LINK
Hi All,I am new gem for developing MVC application's. I created an MVC 4 application using VS 2013.
In oracle I have one table as SSO having two columns as SSOID and SSONUM.
I created one Procedure to get data on the basis of requested ID.
CREATE OR REPLACE PROCEDURE GETSSODETAILS (
cursorParameter OUT SYS_REFCURSOR,
p_ssoid IN SSO.SSOID%TYPE
)
as
SSONum SSO.SSOnum%TYPE;
SSOid SSO.SSOid%TYPE;
cursor CursorParam is
SELECT * FROM SSO WHERE SSOID=p_ssoid;
BEGIN
OPEN cursorParam;
if cursorParam%ISOPEN THEN
FETch cursorParam into SSONum, SSOid;
dbms_output.put_LINE('SSONum = ' || SSONum || ' SSOid = ' || SSOid);
END IF;
END;
Now I added ADO .Net ENtity Model Framework in my project to work with Db Context.
After that In HomeController.cs class i have below code :
public ActionResult Index()
{
Entities entities = new Entities();
var output = entities.GETSSODETAILS(1);
return View(output);
}
Which makes a call to my Model1.context.cs and there I have code as below
public virtual ObjectResult<SSODetails> GETSSODETAILS( Nullable<decimal> p_SSOID)
{
var p_SSOIDParameter = p_SSOID.HasValue ?
new ObjectParameter("P_SSOID", p_SSOID) :
new ObjectParameter("P_SSOID", typeof(decimal));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SSODetails>("GETSSODETAILS", p_SSOIDParameter);
}
When I am running this code, It gives me error as below
ORA-06550: line 1, column 8:
PLS-00306: wrong number or types of arguments in call to 'GETSSODETAILS'
ORA-06550: line 1, column 8:
PL/SQL: Statement ignored
Please let me know Am I doing something wrong..?? I believe I have to pass one more parameter in my Model1.context.cs function while calling ExecuteFunction() method. and that should be output parameter. I am not able to declare output parameter which works with CURSOR type in Oracle.
Spent my last four days on this. Would be great if anyone can help me asap. I have deadlines to kick off my project.
I will be lucky if someone can send dummy project for the same requirements. VS 2013, using Oracle Database with the help of ODP .Net using ENtityFramework, Calling procedure.
Thanks
Virender Sasmal
Star
8544 Points
1376 Posts
Re: MVC Application with Oracle DB
Mar 27, 2015 04:40 AM|Edwin Guru Singh|LINK
As per your case, the following link which may guide you to fix this issue
1. Click here to get complete video tutorial with screenshot explanation of MVC ODP.net project using entity framework
2. Click here to refer this forum link which had discussion about Oracle ODP.Net With Entity Framework 6 - Entity framework database compatible provider
--
with regards,
Edwin
Edwin