function problems
От | Christine Penner |
---|---|
Тема | function problems |
Дата | |
Msg-id | 19740413173256.E54EB0C1F4E7F4C9@edtnaa20.telusplanet.net обсуждение исходный текст |
Ответы |
Re: function problems
Re: function problems |
Список | pgsql-general |
I am trying to write a postgres function and I'm getting errors when the parameter sub is empty (it wont ever be null) and meetCode has a number. This is the function code: create or replace function SubjectDisplay(IN subj varchar,IN meetCode numeric,IN meetTrWP integer,OUT Display varchar) returns varchar as $BODY$ Declare meetType varchar; BEGIN IF subj='' Then if meetCode=0 Then if meetTrWp=0 Then Select S_MEETING_TITLE as Display from System Limit 1; Return; elseif meetTrWp=1 Then Select S_TRAINING_TITLE as Display from System Limit 1; Return; else Select S_WP_TITLE as Display from System Limit 1; Return; end if; else --This is where I run into problems. I get an error when I run it. Query has no destination for result data Select MT_DESCRIPTION as meetType from MEETING_TYPE Where MT_CODE=meetCode; Display := meetType Return; end if; else Display := subj Return; end if; Return; END; $BODY$ LANGUAGE plpgsql IMMUTABLE COST 100; Christine Penner
В списке pgsql-general по дате отправления: