've just started learning oracle pl/sql and I'm facing some problem here.
I've no problem compiling it but whenever I execute the procedure nth would appear except the following message and not showing any output which shld not be the case: anonymous block completed
i've tried to set serveroutput on size 50000; but nth changes.
here's my pl/sql procedure not sure if i'm doing it right.
CREATE OR REPLACE PROCEDURE VERIFY AS
empnum NUMBER;
empname VARCHAR2(50);
BEGIN
select employee.e#
, employee.name
into empnum
, empname
from employee join driver on driver.e# = employee.e#
join mechanic on mechanic.e# = driver.e#;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('ok');
END VERIFY;
/
I'm trying to achieve the same result from the following sql query:
select employee.name, employee.e#
from employee join driver
on driver.e# = employee.e#
join mechanic
on mechanic.e# = driver.e#
where rownum = 1;
so if there's any similar records it will show the employee name and num.. if there's no similar records found it will display a ok message.