title: as it should be this code? Its a Oracle Procedure with if and else
body: <p>Please I try to make a procedure to copy from one table to another and then delete the contents of the previous with if and else sentences. (PERSONA1 and PERSONA1_BKP are created)</p>
  
  <pre><code>create or replace procedure TRASLADO(DNI VARCHAR2)
  as
  v_DNI varchar2(8);
  v_GP char(6);
  v_PRIMER varchar2(40);
  v_SEGUNDO varchar2(40);
  v_PRENOM varchar2(40);
  v_GENERO char(1);
  v_FECHA DATE;
  
  begin
  
        SELECT NU_DNI, GP_VOTACION, AP_PRIMER, AP_SEGUNDO, PRENOM_INSCRITO, DE_GENERO, FE_INSCRIPCION
        INTO v_DNI, v_GP, v_PRIMER, v_SEGUNDO, v_PRENOM, v_GENERO, v_FECHA /*se usa into para que la variable pueda usar lo que se le envia*/ 
        FROM PERSONA1
        WHERE NU_DNI=DNI;
        IF (NU_DNI=DNI)
        BEGIN
        insert into PERSONA1_BKP values(v_DNI, v_GP, v_PRIMER, v_SEGUNDO, v_PRENOM, v_GENERO, v_FECHA, SYSDATE);
        delete from PERSONA1 where DNI LIKE NU_DNI;
        END
        ELSE 
        BEGIN
        dbms_output.put_line('EL DNI NO EXISTE');
        END
  
  
  end TRASLADO;
  </code></pre>