Which of the following keywords is NOT present in a 'function declaration'?
-
Declare
-
Begin
-
Return
-
Exception
A
Correct answer
Explanation
The declaration section of a PL/SQL program is used to contain all variable declarations. While using a function, the declare keyword is replaced by 'is' keyword. All the variables are declared inside the 'is' keyword. For example,
CREATE OR REPLACE FUNCTION myfunc
RETURN VARCHAR(20);
IS
sname VARCHAR(20);
BEGIN
SELECT studname INTO sname
FROM students WHERE rollno = 1;
RETURN sname;
END;/