I snipped the errors out of the crashing function, and next error seems to be
in the attatched file.
Richard
On Tuesday 10 January 2006 11:53, Richard Terry wrote:
> Looks like it is crashing in this function, but I'll try and test it later
> today. I'm going to try and incrementally build gnumed from the scripts. If
> you find a fix please post it.
>
> Regards
>
> richard
>
> 2006-01-10 08:42:36 [DATA]
> (/home/richard/gnumed/gnumed/Gnumed/pycommon/gmPsql.py:[EMAIL PROTECTED]):
> ../sql/gmI18N-dynamic.sql:35: ERROR: syntax error at or near "on" at
> character 22
> 2006-01-10 08:42:36 [DATA]
> (/home/richard/gnumed/gnumed/Gnumed/pycommon/gmPsql.py:[EMAIL PROTECTED]):
> 2006-01-10 08:42:36 [DATA]
> (/home/richard/gnumed/gnumed/Gnumed/pycommon/gmPsql.py:[EMAIL PROTECTED]):
> create function i18n.set_curr_lang(text, name)
> returns unknown
> language 'plpgsql'
> security definer
> as '
> DECLARE
> _lang ALIAS FOR $1;
> it
>
> On Tuesday 10 January 2006 09:08, Karsten Hilbert wrote:
> > On Tue, Jan 10, 2006 at 08:17:53AM +1100, Richard wrote:
> > > Anway, is it possible to create gnumed entirely from the sql's in the
> > > sql directory,
> >
> > You will also need to make sure you generate all the audit
> > trail/notification functions and triggers.
> >
> > Karsten
>
> _______________________________________________
> Gnumed-devel mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/gnumed-devel
2006-01-10 12:17:58 [DATA]
(/home/richard/gnumed/gnumed/Gnumed/pycommon/gmPsql.py:[EMAIL PROTECTED]):
create or replace function dem.set_nickname(integer, text) returns integer as '
DECLARE
_id_identity alias for $1;
_nick alias for $2;
_names_row record;
msg text;
BEGIN
-- 0.1: Just always set the nickname inside the active name
-- post 0.1: openEHR-like (name: pk, fk_identity, name, fk_type,
comment, is_legal, is_active ...)
-- does name exist ?
select into _names_row * from dem.names where id_identity =
_id_identity and active = true;
if not found then
msg := ''Cannot set nickname ['' || _nick || '']. No active
<names> row with id_identity ['' || _id_identity || ''] found.''
raise exception msg;
end if;
-- can directly set nickname ?
-- if _names_row.preferred is null then
update dem.names set preferred = _nick where id = _names_row.id;
return _names_row.id;
-- end if;
-- must create new row
-- 1) deactivate old row ...
-- update dem.names set active = false where id = _names_row.id;
-- 2) insert new row from old row and new data ...
--insert into dem.names (id_identity, active, firstnames, lastnames,
preferred, comment)
-- values (_id_identity, true, _names_row.firstnames,
_names_row.lastnames, _nick, _names_row.comment);
--if found then
-- return currval(''names_id_seq'');
--end if;
--return NULL;
END;' language 'plpgsql'
2006-01-10 12:17:58 [ERROR]
(/home/richard/gnumed/gnumed/Gnumed/pycommon/gmPsql.py:[EMAIL PROTECTED]):
../sql/gmDemographics-Person-views.sql:159: ERROR: syntax error at or near
"raise" a
t character 112QUERY: SELECT 'Cannot set nickname [' || $1 || ']. No active
<names> row with id_identity [' || $2 || '] found.' raise exception $3
CONTEXT: SQL statement
in PL/PgSQL function "set_nickname" near line 13
_______________________________________________
Gnumed-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnumed-devel