PostgreSQL failed on Select
I think it should be;

    DECLARE 
      _port int;
    BEGIN
      select alter_port into _port from a_table where ....;
      select data into data_list from a_table where PortNumber = _port;