Check for integer in string array

后端 未结 2 989
名媛妹妹
名媛妹妹 2021-01-28 14:06

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

2条回答
  •  粉色の甜心
    2021-01-28 14:18

    I found the following to provide the desired result:

    IF nc_ecosite in 
    (select (unnest(string_to_array(current_consite, ',')))::integer 
    from current_site_record 
    where current_ecosite_nc::integer = nc_ecosite) THEN
       ecosite := nc_ecosite::integer;
    

提交回复
热议问题