CREATE TABLE emp ( enpno varchar(4), empname varchar(30), designation varchar2(10), category char(1), basicsalary number(4), joined date )
DECLARE mysal number;
sal NUMBER:=&salary;
BEGIN
SELECT basicsalary INTO mysal
FROM emp
WHERE basicsalary =sal;
exception WHEN too_many_rows THEN dbms_output.put_line('too many data found in result can''t handel ');
WHEN no_data_found THEN dbms_output.put_line('no data found for your query');
END;
/