Example: PLSQL Cursor with parameters updating the current line

Here is a example how to use cursor with parameters in PLSQL accessing each row
of the given table and changing it’s value.

declare
  cursor c_funcionario(p_matricula in number) 
    is (select * from funcionario where matricula = p_matricula) for update;
begin

  for currentFuncionario in c_funcionario(2) loop
    update funcionario set salario = 300 where current of c_funcionario;
  end loop;
  
  commit;
end;

How to create a PACKAGE in oracle

PACKAGE HEADER

create or replace PACKAGE MY_PACK AS 

  /* TODO enter package declarations (types, exceptions, methods etc) here */ 
    
  PROCEDURE PROCEDURE_1(v_texto in out varchar2);
  FUNCTION FUNCTION_1(v_parametroEntrada in varchar2) return varchar2;

END MY_PACK;

PACKAGE BODY

create or replace package body MY_PACK
IS

  PROCEDURE PROCEDURE_1(v_texto in out varchar2) IS 
  BEGIN
    v_texto := 'my return';
  END PROCEDURE_1;
  
  FUNCTION FUNCTION_1(v_parametroEntrada in varchar2) return varchar2 is
  begin
    return v_parametroEntrada;
  end;

END MY_PACK;