Undeclared Bind Variable - PL / SQL

1

I am programming a PL / SQL for the first time, and at the time of executing it it tells me that there is a Bind variable that is not declared, but it is, it would be the variable vFhfechax :

Code:

DECLARE

vFecha_proceso          VARCHAR2(20);
vFhfechax             T0CIHECP.FHFECHAX%TYPE;
BEGIN

 --INICIALIZAMOS CONSTANTES
vFhfechax:=TO_DATE('31/12/9999','DD/MM/YYYY');

RECUPERAMOS LA FECHA DE PROCESO
  vFecha_proceso:=to_date('&1','dd/mm/yyyy');
 vFhfechax:=vFecha_proceso;

Why is this happening?

    
asked by elvega 15.11.2016 в 13:20
source

2 answers

0

I do not get an error more than the type that I do not have it, changing the data type to varchar2 (20) to the variable vFhfechax to see if that is not the problem, in syntax everything seems to be OK

DECLARE

vFecha_proceso          VARCHAR2(20);
vFhfechax             varchar2(20);--T0CIHECP.FHFECHAX%TYPE;
BEGIN

 --INICIALIZAMOS CONSTANTES
vFhfechax:=TO_DATE('31/12/9999','DD/MM/YYYY');

--RECUPERAMOS LA FECHA DE PROCESO
  vFecha_proceso:=to_date('&1','dd/mm/yyyy');
 vFhfechax:=vFecha_proceso;
 end;
    
answered by 07.12.2016 в 16:07
0

Good day elvega, the data type T0CIHECP.FHFECHAX% TYPE; must be DATE, you can verify that it is so, so there would be no problem in leaving the PL / SQL so

    DECLARE

    vFecha_proceso          VARCHAR2(20);
    vFhfechax             T0CIHECP.FHFECHAX%TYPE;
     BEGIN

     --INICIALIZAMOS CONSTANTES
      vFhfechax:=TO_DATE('31/12/9999','DD/MM/YYYY');


    vFecha_proceso:=to_date('&1','dd/mm/yyyy');
    vFhfechax:=vFecha_proceso;

   end;
    
answered by 18.01.2018 в 23:13