ORA-06550:第 1 行,第 7 列:PLS-00306:调用“UPDATEPHOTO”时参数的数量或类型错误
ORA-06550:第 1 行,第 7 列:PL/SQL:语句被忽略Oracle.ManagedDataAccess.Client.OracleException
我不知道程序或我的代码有什么问题。
这是我的存储过程
create or replace
PROCEDURE UpdatePhoto
(
v_ac_photo_fileName IN VARCHAR2 DEFAULT NULL ,
v_ac_photo_contentType IN VARCHAR2 DEFAULT NULL ,
v_ac_photo_Data IN BLOB DEFAULT NULL ,
v_ac_uniqueID IN VARCHAR2 DEFAULT NULL
)
AS
BEGIN
UPDATE account_table
SET ac_photo_fileName = v_ac_photo_fileName,
ac_photo_contentType = v_ac_photo_contentType,
ac_photo_Data = v_ac_photo_Data
WHERE ac_uniqueID = v_ac_uniqueID;
END;
这是我的 C# 代码:
public int UpdatePhoto(BO nBo)
{
OracleConnection ocon = new OracleConnection(orastr);
OracleCommand ocmd = new OracleCommand("UpdatePhoto", ocon);
ocmd.CommandType = CommandType.StoredProcedure;
ocon.Open();
try
{
ocmd.Parameters.Add("ac_uniqueID", nBo.account_uniqueID);//String
ocmd.Parameters.Add("ac_photo_fileName", nBo.account_photo_fileName);//string
ocmd.Parameters.Add("ac_photo_contentType", nBo.account_photo_contentType);//string
ocmd.Parameters.Add("ac_photo_Data", nBo.account_photo_Data);// (Byte[] photo data)
// tried these also
ocmd.Parameters.Add("ac_uniqueID", OracleDbType.Varchar2, ParameterDirection.Input).Value = nBo.account_uniqueID;
ocmd.Parameters.Add("ac_photo_fileName", OracleDbType.Varchar2, ParameterDirection.Input).Value = nBo.account_photo_fileName;
ocmd.Parameters.Add("ac_photo_contentType", OracleDbType.Varchar2, ParameterDirection.Input).Value = nBo.account_photo_contentType;
ocmd.Parameters.Add("ac_photo_Data", OracleDbType.Blob, ParameterDirection.Input).Value = nBo.account_photo_Data;
return ocmd.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
finally
{
ocon.Dispose();
ocon.Close();
nBo = null;
}
}