plpgsql function gets wierd with Null parameters

Поиск
Список
Период
Сортировка
От Skeets and Kim Norquist
Тема plpgsql function gets wierd with Null parameters
Дата
Msg-id 20000628.112753.-439695.1.norqu2@juno.com
обсуждение исходный текст
Список pgsql-sql
When I call the following plpgsql function with the last two parameters
as Null, the first parameter loses it's value:   ma=> select createFund('fred', null, null);    createfund
------------     (1 row)    
 

However it works fine when I give values to the last two params:   ma=> select createFund('fred', 'joe', 5);
createfund  ------------    fred   (1 row)
 

Here's the function (I've hacked it so that it just returns the first
parameter):   create function createFund(varchar, varchar, int) returns text as '   DECLARE           fundname
ALIASFOR $1;           fundsymbol      ALIAS FOR $2;           fundcusip       ALIAS FOR $3;           existing
varchar(100);          fundid          int;           rec                     RECORD;           retval          text;
       datecount       smallint;   BEGIN           RETURN fundname;           ...   END;   ' language 'plpgsql';
 

Any ideas?

-Skeets Norquist
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Brian Powell
Дата:
Сообщение: Backup of BLOBS
Следующее
От: tolik@aaanet.ru (Anatoly K. Lasareff)
Дата:
Сообщение: Re: trigger or something else?