Re: plpython question

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: plpython question
Дата
Msg-id 316656.20041019094313@compulab.co.il
обсуждение исходный текст
Ответ на Re: plpython question  (Hagen Hoepfner <Hagen.Hoepfner@gmx.de>)
Список pgsql-general
I had tried it exactly the way I wrote it in python as a function and it
worked.

Just in case I tried changing it to return ("OK") as you suggested and
got the same error.

Thank You
Sim Zacks
IT Manager
CompuLab
04-829-0145 - Office
04-832-5251 - Fax

________________________________________________________________________________

I don't know plpythonu but python ;-) As I really understood your
problem you want to return strings. In Pytho return("OK" ) should work ;-)

Hagen

Sim Zacks wrote:

>I have the following function and I am getting an invalid syntax error
>when I try to run it. I have tried the function a number of ways
>including with named parameters and non-named parameters using the
>args array. I also tried it with a tab at the beginning and without.
>I've also tried with the $$ and with single quotes and the double
>single quoting all the existing single quotes.
>
>Any help would be greatly appreciated.
>
>create or replace function BatchBalanceStatus(balance int, needed int, freestock int) returns varchar as
>$$
>        if balance < 0:
>                return 'Unhandled'
>        elif freestock >= needed:
>                return 'OK'
>        else:
>                return 'Ordered'
>$$ language plpythonu
>
>Thank You
>Sim Zacks
>IT Manager
>CompuLab
>04-829-0145 - Office
>04-832-5251 - Fax
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>               http://archives.postgresql.org
>
>
>
>


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Another list for windows port...
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Win32 Question