Re: converting an oracle procedure to postgres

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: converting an oracle procedure to postgres
Дата
Msg-id 200310201428.24871.josh@agliodbs.com
обсуждение исходный текст
Ответ на converting an oracle procedure to postgres  ("Clint Stotesbery" <cstotes@hotmail.com>)
Список pgsql-sql
Clint,

>       v_taxstatus  varchar(1);
>       v_shipping   varchar(12);

Drop the varchar limits, it's not supported inside PL/pgSQL.

> I know I have to relpace the word PROCEDURE with FUNCTION but then it wants
> me to put RETURNS <datatype> but I don't want to return anything. I was
> thinking that I could just have it return integer and then after the last
> update statement put return 0. I'd rather not have it return a junk value
> though. What should I do?

I generally return integer or boolean for such functions.  For example, you
can have it return "TRUE" at the end, and then your client code can interpret
any non-true result (Error message, null) as an error.

--
-Josh BerkusAglio Database SolutionsSan Francisco



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

Предыдущее
От: "Clint Stotesbery"
Дата:
Сообщение: converting an oracle procedure to postgres
Следующее
От: Tom Lane
Дата:
Сообщение: Re: converting an oracle procedure to postgres