Based on EMP and DEPT tables:https://livesql.oracle.com/apex/livesql/file/content_O5AEB2HE08PYEPTGCFLZU9YCV.html
I need to create a function that shows total salaries from a city(My choice is BOSTON).Problem is I get an error.The function must be called from an anonimous block.
SET SERVEROUTPUT ON;
CREATE OR REPLACE FUNCTION show_sal (local dept.loc%TYPE)RETURN NUMBER AS
vval NUMBER;
BEGIN
SELECT SUM(SAL)INTO vval FROM emp INNER JOIN dept ON dept.deptno=emp.deptno
HAVING UPPER(dept.loc)=UPPER(local);
RETURN vval;
END;
/
BEGIN
DBMS_OUTPUT.PUT_LINE('Total sum of salaries ='||sal_afis('BOSTON'));
END;
/
sal_afis?