[Top][All Lists]

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

Re: [Gnumed-devel] Eureka! - ?found the error gnuMed running now

From: Richard Terry
Subject: Re: [Gnumed-devel] Eureka! - ?found the error gnuMed running now
Date: Thu, 8 Dec 2005 08:47:07 +1100
User-agent: KMail/1.9

Have the gnuMed client running now, with standard postgres.conf and 

After much stuffing around, I've narrowed the problem down to the text below.
Karsten: if I removed your text from between the if not found then and endif, 
and replace it with a simple error message, the whole database continues to 
boot and the gnumed client runs.

 see the section below separated by lines of ============== characters which 
contain the difference.


create function set_nickname(integer, text) returns integer as '
        _id_identity alias for $1;
        _nick alias for $2;
        _names_row record;
        -- 0.1: Just always set the nickname inside the active name
        -- post 0.1: openEHR-like (name: pk, fk_identity, name, fk_type, 
is_legal, is_active ...)
        -- does name exist ?
        select into _names_row * from names where id_identity = _id_identity 
active = true;

Original text:

        if not found then
                msg := ''Cannot set nickname ['' || _nick || '']. No active 
<names> row with 
id_identity ['' || _id_identity || ''] found.''
                raise exception msg;
        end if;
Replaced with this, it now works:

        if not found then
                raise exception '' my message'';
        end if;
So I guess the syntax error is in your text somewhere.

        -- can directly set nickname ?
        -- if _names_row.preferred is null then
        update names set preferred = _nick where id =;
        -- end if;
        -- must create new row
        -- 1) deactivate old row ...
        -- update names set active = false where id =;
        -- 2) insert new row from old row  and new data ...
        --insert into names (id_identity, active, firstnames, lastnames, 
        --      values (_id_identity, true, _names_row.firstnames, 
_nick, _names_row.comment);
        --if found then
        --      return currval(''names_id_seq'');
        --end if;
        --return NULL;
END;' language 'plpgsql';

On Thursday 08 December 2005 08:18, Richard Terry wrote:
> Back to not booting demographics again with the fresh update!!!.

reply via email to

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