Or using implicit statement results - if you're on Oracle 12c or higher version Database. This feature was added to make migrating your code from SQL Server easier.
CREATE OR REPLACE PROCEDURE fx (par_deptno IN NUMBER)
AS
l_cursor_1 SYS_REFCURSOR;
BEGIN
OPEN l_cursor_1 FOR
SELECT department_id, first_name, last_name, job_id, salary
FROM employees
WHERE department_id = par_deptno;
DBMS_SQL.RETURN_RESULT(l_cursor_1);
END;
/
And then execute the program
DECLARE
PAR_DEPTNO NUMBER;
BEGIN
PAR_DEPTNO := 100;
FX(
PAR_DEPTNO => PAR_DEPTNO
);
END;
The output is auto-magically returned from the database:

Examples/docs on Oracle-Base
CREATE FUNCTIONin Oracle creates a PL/SQL stored function. Stored functions in SQL Server use Transact-SQL. These are not the same thing and neither of them is standard SQL. Hence the syntax is not identical. You need to learn PL/SQL syntax in order to create PL/SQL functions.