Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a procedure which is sorting the values that have been taken from the table, and it is displaying the correct result. but how to take that result and display it in the table.
Can any one please tell me how to return the result in the table from procedure?
Posted

add a cursor out put param in code

cmd.parameter.add("outcursor",Oracletype.cursor).direction=Parameterdirection.output;
datatable dt=cmd.ExecuteReqader();

SP
---

declare//
outcursor sys_refcursor
begin

open outcursor for
select * from.............
// your table select qry


end;
 
Share this answer
 
Comments
Member 10740412 29-Nov-14 6:01am    
i don't have any idea of how to add OUTCURSOR
[no name] 30-Nov-14 23:30pm    
i will show u a simple example ....
[no name] 30-Nov-14 23:34pm    
pls check in solution section...
CREATE OR REPLACE PROCEDURE SP_sample
(
STROUT OUT SYS_REFCURSOR)
AS
BEGIN
OPEN STROUT FOR
SELECT * from tabletest;
END;
/



in c# code

cmd.CommandText = "SP_sample"
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add("STROUT", OracleType.Cursor).Direction = ParameterDirection.Output;
dt = DAOCLASS.ExecuteReader(cmd);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900