Enviado em 24/08/2011 - 06:56h
enganei-me. Tenho assim:
while : ; do
read campo_rua
MSG_ERR='does not exist'
ERR='relation "$campo_rua" does not exist'
GET_RST=$(echo $ERR | cut -d ' ' -f 2-)
if [ "$GET_RST" != "$MSG_ERR" ]
then psql -d $nomemuni -c "UPDATE $nome_passeios SET rua = (SELECT $campo_rua FROM $nome_ruas ORDER BY ST_Distance( Line_Interpolate_Point_Alter($nome_ruas.wkb_geometry, 0.5), $nome_passeios.wkb_geometry) ASC LIMIT 1)" && break
fi
done
while : ; do
read campo_rua
MSG_ERR='does not exist'
ERR='relation "$campo_rua" does not exist'
GET_RST=$(echo $ERR | cut -d ' ' -f 2-)
if [ "$GET_RST" != "$MSG_ERR" ]
then psql -d $nomemuni -c "UPDATE $nome_passeios SET rua = (SELECT $campo_rua FROM $nome_ruas ORDER BY ST_Distance( Line_Interpolate_Point_Alter($nome_ruas.wkb_geometry, 0.5), $nome_passeios.wkb_geometry) ASC LIMIT 1)" && break
fi
done