日期:2014-05-18  浏览次数:20509 次

Oracle创建存储过程,没错 但是执行时报错
建的语句
CREATE OR REPLACE PROCEDURE msp_SM_INTERIM_T_Delete(pGBID VARCHAR2,pID VARCHAR2,pMID VARCHAR2,pReturnValue out NUMBER) AS
BEGIN
  DELETE FROM SM_CHECK_RECORD_TEMP WHERE (GDBH_ID = pGBID);
  DELETE FROM SM_GOODSBATCH_BASE_TEMP WHERE (ID = pGBID);
  DELETE FROM SM_GOODS_INFO_TEMP WHERE (ID = pID);
  DELETE FROM SM_MAKER_CERT_TEMP WHERE (MAKER_ID = pMID); 
  DELETE FROM SM_MAKER_BASE_INFO_TEMP WHERE (ID = pMID);
  pReturnValue:=1;
EXCEPTION
  WHEN OTHERS THEN  
  pReturnValue:=0;
  RETURN;
END msp_SM_INTERIM_T_Delete;



代码执行语句:

public static int DeleteInterim(String GBID,String GID,String MID)
  {
  int ret;
  using (DbAccess db = new DbAccess())
  {
  using (IDbCommand cmd = db.CreateProcCommand("SM_CHECK_RECORD_TEMP"))
  {
  DbAccess.AttachInParameter(cmd, "pGBID", DbType.String, GBID);
  DbAccess.AttachInParameter(cmd, "pID", DbType.String, GID);
  DbAccess.AttachInParameter(cmd, "pMID", DbType.String, MID);
  DbAccess.AttachOutParameter(cmd, "pReturnValue", DbType.Int32, 4);
  db.ExecuteNonQuery(cmd);
  ret = Convert.ToInt32(((IDbDataParameter)cmd.Parameters[1]).Value);
  }
  }
  return ret;
  }
报错:
用户代码未处理
ORA-06550: 第 1 行, 第 7 列: 
PLS-00221: 'SM_CHECK_RECORD_TEMP' 不是过程或尚未定义
ORA-06550: 第 1 行, 第 7 列: 
PL/SQL: Statement ignored

------解决方案--------------------
C# code
  cmd.CommandType= CommandType.StoredProcedure;

------解决方案--------------------
DbAccess db = new DbAccess()你的链接是用access还是orancle啊?是不是连接的地方错了
------解决方案--------------------
http://wenku.baidu.com/view/f910dc6527d3240c8447ef63.html
我的异常网推荐解决方案:oracle存储过程,http://www.aiyiweb.com/oracle-develop/177537.html