I am trying to check a string array for existence of a converted integer number. This sits inside of a procedure where:
nc_ecosite
is an integer
variable
current_consite
is a string array
ecosite
is an integer
current_ecosite_nc
is double
IF to_char(nc_ecosite, '999') IN
(select current_consite from current_site_record
where current_ecosite_nc::integer = nc_ecosite) THEN
ecosite := nc_ecosite;
The result always comes from the ELSIF
that follows the first IF
. This occurs when nc_ecosite
is in the array (from checks). Why is ecosite
not being populated with nc_ecosite
when values are matching?
I am working with Postgres 9.3 inside pgAdmin.