0
我想從數據庫TimesTen的數據加載到數據表,但我得到的錯誤 這裏負載數據是我的代碼ODP.NET:錯誤時從TimesTen的REFCURSOR到數據表
腳本:
create or replace FUNCTION APITT_tbl_request(prefix_db IN VARCHAR2) RETURN SYS_REFCURSOR AS
res SYS_REFCURSOR;
BEGIN
OPEN res FOR SELECT * FROM APITT_tbl_request_in;
RETURN res;
END;
C#代碼
conn = new OracleConnection(conf.GetAPIDatabaseConnectionString());
conn.Open();
OracleTransaction tran = conn.BeginTransaction(IsolationLevel.ReadCommitted);
OracleCommand command = new OracleCommand();
DataTable dt = new DataTable();
command = new OracleCommand(@"BEGIN :RETURNCURSOR := APITT_tbl_request(:prefix_db); END;");
command.CommandType = CommandType.Text;
command.Parameters.Add("RETURNCURSOR", OracleDbType.RefCursor, ParameterDirection.ReturnValue);
command.Parameters.Add("prefix_db", OracleDbType.Varchar2, ParameterDirection.Input).Value = prefix_db;
OracleDataAdapter da = new OracleDataAdapter(command);
da.Fill(dt);
da.Fill(dt)中的錯誤;
{System.InvalidOperationException: Operation is not valid due to the current state of the object. at Oracle.DataAccess.Client.OracleCommand.ExecuteReader