RDBMS Practical 5
RDBMS Practical 5
The PL/SQL Function is very similar to PL/SQL Procedure. The main difference between procedure and a
function is, a function must always return a value, and on the other hand a procedure may or may not return
a value. Except this, all the other things of PL/SQL procedure are true for PL/SQL function too.
DELIMITER $$
param1,
param2,…
RETURNS datatype
[NOT] DETERMINISTIC
BEGIN
-- statements
END $$
DELIMITER ;
Here:
DELIMITER $$
RETURNS VARCHAR(25)
DETERMINISTIC
BEGIN
END IF;
RETURN (FeeLevel);
END$$
DELIMITER ;
WHERE db = 'pl/sql_4
Output
SELECT
student_id,
student_name,
student_dept,
fee,
StudentFeeLevel(fee)
FROM
student
ORDER BY
student_id;