在以下存储过程中,我遇到了错误:
DROP PROCEDURE IF EXISTS `SP_DeleteFileInfo`;
CREATE PROCEDURE `SP_DeleteFileInfo`(pFileID int)
Set @FileRef= null;
select filesinfo.ReferenceID into @FileRef FROM filesinfo where filesinfo.FileID =pFileID;
DELETE From filesinfo
WHERE filesinfo.FileID= pFileID;
IF EXISTS(SELECT * from filesrefrences where filesrefrences.ReferenceID= @FileRef and filesrefrences.RefrenceCount>1) then
update filesrefrences
set
filesrefrences.RefrenceCount= filesrefrences.RefrenceCount-1
where
filesrefrences.ReferenceID= @FileRef;
SELECT @FileRef;
ELSE IF(@FileRef is Not NULL) THEN
DELETE from filesrefrences WHERE filesrefrences.ReferenceID = @FileRef;
SELECT -77;
ELSE
SELECT -99;
end if;
遇到的错误是:
[SQL]
select filesinfo.ReferenceID into @FileRef FROM filesinfo where filesinfo.FileID =pFileID;
[Err] 1054 - **Unknown column 'pFileID' in 'where clause'**
解决此错误的最佳解决方案是什么?