Search Postgresql Archives

How to use parameters in stored procedures?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I'm very new to PostgresSQL, coming from MS SQL. I'm trying to write a
function that will select a row from a location:

CREATE FUNCTION SelectLocation(IN "myLocationID" int4) RETURNS
"Location"
LANGUAGE 'sql' AS
$BODY$
SELECT
	"LocationID",
	"Name",
	"PhoneNumber",
	"FaxNumber",
	"EmailAddress",
	"StreetAddress",
	"City",
	"Province",
	"PostalCode"
FROM "Location"
WHERE "LocationID" = "myLocationID"
ORDER BY "Name";
$BODY$

I get an error that the column myLocationID doesn't exist. I'm sure
it's something simple, but I can't figure it out.

Also too, why do I have to quote columns and tables?

Thanks guys,
Mike



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux