plpython question

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: plpython question
Date: 2004-10-19 06:58:39
Message-ID: 1683715459.20041019085839@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hagen Hoepfner 2004-10-19 07:27:50 Re: plpython question
Previous Message Kris Jurka 2004-10-19 06:57:47 Re: Avoiding explicit addDataType calls for PostGIS