Fórum Update Tabela #387319
27/09/2010
0
update movusu set id_cidade = 2 where id_cidade = ' ASSIS BRASIL' update movusu
set id_cidade = 3 where id_cidade = ' BRASILEIA' Existe alguma forma de colocar tudo dentro do mesmo comando? Exemplo: update movusu set id_cidade = 1 where id_cidade = ' ACRELANDIA' set id_cidade = 2 where id_cidade = ' ASSIS BRASIL' set id_cidade = 3 where id_cidade = ' BRASILEIA'
Sérgio
Curtir tópico
+ 0Posts
27/09/2010
Eriley Barbosa
update movusu set id_cidade = 2 where id_cidade = ' ASSIS BRASIL' ; update movusu
set id_cidade = 3 where id_cidade = ' BRASILEIA' ;
Gostei + 0
27/09/2010
Sérgio
set id_cidade = 1 where id_cidade = ' ACRELANDIA' ;
update movusu
set id_cidade = 2 where id_cidade = ' ASSIS BRASIL' ;
update movusu
set id_cidade = 3 where id_cidade = ' BRASILEIA' Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 3, char 1.
update.
(se colocar ; no final acusa o mesmo erro)
Gostei + 0
27/09/2010
Emerson Nascimento
update movusu set
id_cidade = (case id_cidade
when ' ACRELANDIA' then '1'
when ' ASSIS BRASIL' then '2'
when ' BRASILEIA' then '3'
else id_cidade end)
Gostei + 0
27/09/2010
Sérgio
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)