Variables not populated after SELECT SQL statement execution