non estrai il dato che hai pescato nella select...

select
esegui la query
estrai valore
esegui l'update con il valore di id estratto.