CREATE TABLE plch_memes
(
meme_id INTEGER,
title VARCHAR2 (100),
description VARCHAR2 (4000)
)
/
BEGIN
INSERT INTO plch_memes
VALUES (
1,
'Cats doing somersaults',
'When that cat flips, the world flips with it.');
INSERT INTO plch_memes
VALUES (
1,
'Cats being the boss',
'Who really “owns” whom?');
COMMIT;
END;
/
CREATE OR REPLACE FUNCTION plch_meme_title (
meme_id_in IN plch_memes.meme_id%TYPE)
RETURN VARCHAR2
IS
CURSOR title_cur
IS
SELECT title
FROM plch_memes
--WHERE meme_id = meme_id_in
;
l_return plch_memes.title%TYPE;
BEGIN
OPEN title_cur;
FETCH title_cur INTO l_return;
CLOSE title_cur;
RETURN l_return;
END;
/
BEGIN
DBMS_OUTPUT.put_Line (plch_meme_title (1));
END;
/
Calling the Function should throw Two Many row exception ? . Why fetch doesn't throw it