游标输出
oracle package
C#
create or replace package PACK_INTERFACE is
type SN_CURSOR is REF CURSOR;
PROCEDURE P_SELECT_SN (RE_SN OUT SN_CURSOR);
end PACK_INTERFACE;
create or replace package body PACK_INTERFACE is
PROCEDURE P_SELECT_SN (RE_SN OUT SN_CURSOR)
IS
p_SN_CURSOR SN_CURSOR;
BEGIN
OPEN P_SN_CURSOR FOR
select * from rmes.r_wip_tracking_t t
WHERE GROUP_ID = 0 AND IN_LINE_TIME > TRUNC(SYSDATE);
RE_SN:=P_SN_CURSOR;
END;
end PACK_INTERFACE;
type SN_CURSOR is REF CURSOR;
PROCEDURE P_SELECT_SN (RE_SN OUT SN_CURSOR);
end PACK_INTERFACE;
create or replace package body PACK_INTERFACE is
PROCEDURE P_SELECT_SN (RE_SN OUT SN_CURSOR)
IS
p_SN_CURSOR SN_CURSOR;
BEGIN
OPEN P_SN_CURSOR FOR
select * from rmes.r_wip_tracking_t t
WHERE GROUP_ID = 0 AND IN_LINE_TIME > TRUNC(SYSDATE);
RE_SN:=P_SN_CURSOR;
END;
end PACK_INTERFACE;
OracleParameter[] param = new OracleParameter[1];
param[0] = new OracleParameter("RE_SN",OracleType.Cursor);
param[0].Direction = ParameterDirection.Output;
DataTable dt = Query.RunProcedure("PACK_INTERFACE.P_SELECT_SN",param,"mes");
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
param[0] = new OracleParameter("RE_SN",OracleType.Cursor);
param[0].Direction = ParameterDirection.Output;
DataTable dt = Query.RunProcedure("PACK_INTERFACE.P_SELECT_SN",param,"mes");
DataGrid1.DataSource = dt;
DataGrid1.DataBind();