Q:

Return ID in insert oracle

I have a package with a INSERT in a sp, and I want to return the id of that insert. The table have a sequence and a trigger for the identity, but in the sp I don't know how can I return the id of the insert that i'm doing, because in the code java I need to use it. 
CREATE OR REPLACE PACKAGE BODY PLUSALT.INSERTAR
IS
PROCEDURE INSERTAR_ESTRATEGIA(
    P_USUARIO     IN VARCHAR2,
    P_CAMPAÑA     IN NUMBER,
    P_FKPLANTILLA IN NUMBER,
    P_NOMBRE      IN VARCHAR2)
IS
BEGIN
  INSERT
  INTO ESTRATEGIA VALUES
    (
      NULL,
      P_CAMPAÑA,
      P_USUARIO,
      P_FKPLANTILLA,
      P_NOMBRE,
      NULL,
      SYSDATE,
      1,
      'Y'
    );
END;
END;
/

Ths is the table
CREATE TABLE ESTRATEGIA
(
    ESID               NUMBER(25) NOT NULL,
    FK_CAMPAÑA         NUMBER(5) NOT NULL,
    FK_USUARIO         NUMBER(8) NOT NULL,
    FK_PLANTILLAESTRA  NUMBER(8),
    ESNOMBRE           VARCHAR2(100),
    ESDESCRIPCION      VARCHAR2(300),
    ESFCHCREACION      DATE,
    FKESTADO           NUMBER(3) NOT NULL,
    ESACTIVA           CHAR(1)
)
;

The sequence 
CREATE SEQUENCE ESTRATEGIA_SEC
START WITH 1 
INCREMENT BY 1 
NOMAXVALUE; 

The trigger
CREATE TRIGGER TRIG_ESTRATEGIA
  BEFORE INSERT ON ESTRATEGIA
  FOR EACH ROW
  BEGIN
    SELECT ESTRATEGIA_SEC.nextval INTO :new.ESID FROM dual;
  END
;

A:

USE RETURNING INTO in the insert with an OUT parameter. Use this parameter  P_ESID in your java code.
CREATE OR REPLACE PACKAGE BODY PLUSALT.INSERTAR
IS
PROCEDURE INSERTAR_ESTRATEGIA(
    P_USUARIO     IN VARCHAR2,
    P_CAMPAÑA     IN NUMBER,
    P_FKPLANTILLA IN NUMBER,
    P_NOMBRE      IN VARCHAR2,
    P_ESID        OUT NUMBER)
IS
BEGIN
  INSERT
  INTO ESTRATEGIA VALUES
    (
      NULL,
      P_CAMPAÑA,
      P_USUARIO,
      P_FKPLANTILLA,
      P_NOMBRE,
      NULL,
      SYSDATE,
      1,
      'Y'
    ) RETURNING ESID INTO P_ESID ;
END;
END;
/

