CREATE OR REPLACE FUNCTION getCustomer(IN name character varying(50))
RETURNS setof record AS
$BODY$
SELECT * FROM Customer WHERE name LIKE '%'||$1||'%';
$BODY$
LANGUAGE 'sql' VOLATILE
COST 100;
ASKER
PostgreSQL is an object-relational database management system with an emphasis on extensibility and standards-compliance. As a database server, its primary function is to store data securely, supporting best practices, and to allow for retrieval at the request of other software applications. PostgreSQL implements the majority of the SQL2011 standard, is ACID-compliant and transactional using multiversion concurrency control (MVCC), and handles complex SQL queries using many indexing methods that are not available in other databases. It is cross-platform and runs on many operating systems including Linux, FreeBSD, OS X, Solaris, and Microsoft Windows.
TRUSTED BY
ASKER
ERROR: syntax error at or near "customer"
LINE 5: results customer;
Open in new window