Create Or Replace Function ASS1_TEST_MSG (pName varchar2) Return varchar2 As
vMsg := '';
Begin
If pName = 'Peter' Then
vMsg := 'Hello Peter. I am a student in Database Systems.';
End If;
Return vMsg;
End;
答案 0 :(得分:3)
您需要声明vMsg
,
试试这个:
CREATE OR REPLACE
FUNCTION ASS1_TEST_MSG(
pName VARCHAR2)
RETURN VARCHAR2
AS
vMsg varchar2(100):= '';
BEGIN
IF pName = 'Peter' THEN
vMsg := 'Hello Peter. I am a student in Database Systems.';
END IF;
RETURN vMsg;
END;