gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Updating dem listings for Brazil


From: Busser, Jim
Subject: Re: [Gnumed-devel] Updating dem listings for Brazil
Date: Mon, 14 Nov 2011 08:22:06 +0000

On 2011-11-13, at 9:07 PM, Jim Busser wrote:

>      AM   | Amapa  --> should be AP
>      AZ   | Amazonas  --> should be AM
>      MG   | Mato Grosso  --> should be MT
>      MR   | Minas Gerais  --> should be MG
>      PR   | Paraiba  --> should be PB
>      PN   | Parana  --> should be PR
> 
> Can / should the above corrections be scripted into the next db fixup?

Provided that no alterations had been made to dem.state where country = 'BR' 
then the following should work. The other option is to delete the originals 
(except it is possible somebody could have linked to them)

UPDATE dem.state
SET code = 'AP' WHERE name = 'Amapa' AND country = 'BR';

UPDATE dem.state
SET code = 'AM' WHERE name = 'Amazonas'  AND country = 'BR';

UPDATE dem.state
SET code = 'MT' WHERE name = 'Mato Grosso'  AND country = 'BR';

UPDATE dem.state
SET code = 'MG' WHERE name = 'Minas Gerais'  AND country = 'BR';

UPDATE dem.state
SET code = 'PB' WHERE name = 'Paraiba'  AND country = 'BR';

UPDATE dem.state
SET code = 'PR' WHERE name = 'Parana'  AND country = 'BR';

-- Jim


reply via email to

[Prev in Thread] Current Thread [Next in Thread]