Joined: Wed Apr 13, 2005 2:38 pm
Location: Surrey, UK
|Posted: Sun Jun 08, 2014 2:13 pm Post subject: Postgres Function poser
|Hi all, I created the function below in postgresql 9.3 on a Windows box and it worked as expected however I've now moved over to using postgres on a Debian wheezy box and my parameter @id seems to be being ignored as no matter what value I pass in the function returns all the records BUT ? if I use $1 instead of @id the function works as expected - is this a Linux thing ? I'm pretty sure I ran this query on a Raspberry pi and it worked using @id and the pi has Debian on it - any ideas ?
FUNCTION spgetallclients("@id" integer) RETURNS SETOF clients AS
$BODY$SELECT id, clientname, addressline1, addressline2, addressline3, postcode,
hometelephone, businesstelephone, mobile, emailpersonal, emailbusiness,
case when @id = -1
then id > @id
else id = @id
We can't stop here, this is bat country. Hunter S Thompson RIP.