Sql Return 语句获取遇到符号错误
Sql Return Statment Getting encountered symbol error
此存储过程返回此错误,但我看不到问题所在:
Error(20,1): PLS-00103: Encountered the symbol "END" when expecting
one of the following: . ( * @ % & = - + ; < / > at in is mod
remainder not rem <> or != or ~= >= <= <> and or
like like2 like4 likec between || multiset member submultiset
create or replace procedure SP_CurrancyOfProject(V_AssyId number) as
temp number := 0;
begin
Select Scope_ID
into Temp
from tbl_Revisions
where Assy_U_ID = V_AssyId;
Select Project_ID
into temp
from tbl_Scope
Where Scope_U_ID = temp;
Select Currancy_Multipier
into temp
from tbl_Currancy
where Project_ID = temp;
return temp;
end;
您不能 return 来自过程的值。
您应该使用 FUNCTION 来 return 值。
create or replace FUNCTION FN_CurrancyOfProject(V_AssyId number) RETURN NUMBER
as
temp NUMBER := 0;
BEGIN
-- YOUR CODE LOGIC for substituting temp variable.
return temp;
END;
此存储过程返回此错误,但我看不到问题所在:
Error(20,1): PLS-00103: Encountered the symbol "END" when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
create or replace procedure SP_CurrancyOfProject(V_AssyId number) as
temp number := 0;
begin
Select Scope_ID
into Temp
from tbl_Revisions
where Assy_U_ID = V_AssyId;
Select Project_ID
into temp
from tbl_Scope
Where Scope_U_ID = temp;
Select Currancy_Multipier
into temp
from tbl_Currancy
where Project_ID = temp;
return temp;
end;
您不能 return 来自过程的值。
您应该使用 FUNCTION 来 return 值。
create or replace FUNCTION FN_CurrancyOfProject(V_AssyId number) RETURN NUMBER
as
temp NUMBER := 0;
BEGIN
-- YOUR CODE LOGIC for substituting temp variable.
return temp;
END;