数据绑定时,在Oracle中调用GET_MANTAL_LOS_MANTAL_STATUS时参数的数量或类型错误

cedebl8k  于 2023-10-16  发布在  Oracle
关注(0)|答案(1)|浏览(71)

我通过存储过程绑定数据,但我得到错误,
在调用“GET_MAGNAL_LOS_MAGNAL_STATUS”时,参数的数量或类型错误\诺拉-06550:
程序如下

create or replace PROCEDURE GET_MANUAL_LOS_REQ_STATUS 
(
  P_CURR OUT SYS_REFCURSOR, 
  P_OUTSTATUS OUT VARCHAR2,
  P_MESSAGE OUT VARCHAR2
) AS 
T_CNT NUMBER :=0;
BEGIN
  OPEN P_CURR FOR
    SELECT LOS.A6_NEID, LOS.SOURCE, LOS.STATUS, LOS.REMARKS,
    LOS.MODIFIED_DATE, LOS.USERNAME, REQ.STATUS LOS_STATUS FROM LOS_REQUEST_MANUAL LOS,
    APP_3DPT.LOS_REQUEST_LOG REQ 
    WHERE LOS.A6_NEID = REQ.LOS_REQUEST_ID ORDER BY MODIFIED_DATE DESC;

  P_OUTSTATUS :='SUCCESS';
EXCEPTION WHEN OTHERS THEN
P_OUTSTATUS :='FAILED';
P_MESSAGE :=SQLERRM;
END GET_MANUAL_LOS_REQ_STATUS;

下面是代码。

public DataTable Bind_Grid_Data()
        {
            OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionStringAirFiber"].ConnectionString);
            try
            {
                OracleCommand cmd = new OracleCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = ConfigurationManager.AppSettings["GET_MANUAL_LOS_REQ_STATUS"];
                cmd.Connection = conn;

                cmd.Parameters.Add(new OracleParameter
                {
                    ParameterName = "P_CURR",
                    OracleDbType = OracleDbType.RefCursor,
                    Size = 500,
                    Direction = ParameterDirection.Output
                });

                cmd.Parameters.Add(new OracleParameter
                {
                    ParameterName = "P_OUTSTATUS",
                    OracleDbType = OracleDbType.RefCursor,
                    Size = 500,
                    Direction = ParameterDirection.Output
                });

                cmd.Parameters.Add(new OracleParameter
                {
                    ParameterName = "P_MESSAGE",
                    OracleDbType = OracleDbType.RefCursor,
                    Size = 500,
                    Direction = ParameterDirection.Output
                });

                if (conn.State != ConnectionState.Open) conn.Open();

                OracleDataAdapter daIPColo = new OracleDataAdapter(cmd);
                DataTable dtIPColo = new DataTable();
                daIPColo.Fill(dtIPColo);
                return dtIPColo;
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                if (conn.State == ConnectionState.Open) conn.Close();
            }
        }
7ivaypg9

7ivaypg91#

可能是一个“复制和粘贴”错误。
您的参数P_OUTSTATUSP_MESSAGEVARCHAR2,但您将它们绑定为OracleDbType.RefCursor.

相关问题