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: Wed, 16 Nov 2011 18:23:05 +0000

On 2011-11-15, at 12:05 PM, Jim Busser wrote:

> therefore, to provide support for the i18n, will that function work if 
> applied to the source column 's_state.name' in the following fashion:
> 
>    SELECT DISTINCT ON (UPPER(s_state.abbr)) UPPER(s_state.abbr),  
> i18n.i18n(s_state.name), 'BR'
>    FROM staging.state s_state ...

Actually, if I am already calling the gm i18n function during the data pack 
insert into a staging table:

    -- country AD
    INSERT into staging.state(code, country, name) VALUES 
('AN','AD',i18n.i18n('Andorra'));
    INSERT into staging.state(code, country, name) VALUES 
('CA','AD',i18n.i18n('Canillo'));
    INSERT into staging.state(code, country, name) VALUES 
('EN','AD',i18n.i18n('Encamp'));
    INSERT into staging.state(code, country, name) VALUES 
('LM','AD',i18n.i18n('La Massana'));
    INSERT into staging.state(code, country, name) VALUES 
('LE','AD',i18n.i18n('Les Escaldes'));
    INSERT into staging.state(code, country, name) VALUES 
('OR','AD',i18n.i18n('Ordino'));
    INSERT into staging.state(code, country, name) VALUES 
('SJ','AD',i18n.i18n('Sant Julia de Lori'));

then (while harmless) it is unnecessary -- at the point of adding missing 
records to the the dem.state table -- to have to re-issue the i18n as

    SELECT DISTINCT ON (UPPER(s_s.code)) UPPER(s_s.code),  i18n.i18n(s_s.name), 
s_s.country
    FROM staging.state s_s ...

and I can just do

    SELECT DISTINCT ON (UPPER(s_s.code)) UPPER(s_s.code),  i18n.i18n(s_s.name), 
s_s.country
    FROM staging.state s_s ...

??

-- Jim


reply via email to

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