You could do something like the following, so that you return variables with the keyword OUT and thus indicate that it is an output parameter (the keyword IN is optional and it only indicates that the parameter is input). In my example below, the procedure returns the number of records affected by the update, an error code and an error message in case of an unhandled exception. The EXCEPTION block will be executed when an exception occurs, whether intentionally thrown or not. In case of an unhandled exception, the OTHERS block will be executed and the Oracle error code and message will be assigned to the SQLCODE and SQLERRM variables . I hope it helps. Almost all of my stored procedures follow the same structure.
CREATE OR REPLACE PROCEDURE spu_modificarTrabajador (
tnombre IN VARCHAR2,
tapellido IN VARCHAR2,
tid_cargo IN NUMBER,
tdireccion IN VARCHAR2,
trut IN VARCHAR2,
tsueldo IN NUMBER,
tcorreo IN VARCHAR2,
tcomuna IN NUMBER,
reg_afectados OUT NUMBER,
cod_err OUT NUMBER,
msg_err OUT VARCHAR2
) IS
BEGIN
cod_err := 0;
msg_err := 'OK';
UPDATE trabajador
SET nombre_trabajador = tnombre,
apellido_trabajador = tapellido,
id_cargo = tid_cargo,
direccion_trabajador = tdireccion,
rut_trabajador = trut,
sueldo = tsueldo,
correo_trabajador = tcorreo,
id_comuna = tcomuna
WHERE rut_trabajador = trut;
reg_afectados := SQL%ROWCOUNT;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
reg_afectados := 0;
cod_err := SQLCODE;
msg_err := SQLERRM;
END;