Error while compiling PL/SQL function in 10g
I've written PL/SQL function wherein i'm retrieving contact details. Here is my PL/SQL function:
CREATE OR REPLACE FUNCTION getOrderContact(contactID IN number)
RETURN SYS_REFCURSOR
AS
st_cursor SYS_REFCURSOR;
BEGIN
OPEN st_cursor FOR
SELECT c.NAME, c.EMAIL, c.STREETADDRESS1, c.STREETADDRESS2, c.CITY, c.PROVINCE, c.COUNTRY, c.POSTALCODE
FROM orders o, contact c
WHERE c.contactID = contactID
AND c.contactID = o.contactID
RETURN st_cursor;
END;
I'm getting following error:
-------------------------------------
ERROR at line 7: PL/SQL: SQL Statement ignored
5. BEGIN
6. OPEN st_cursor FOR
7. SELECT c.NAME, c.EMAIL, c.STREETADDRESS1, c.STREETADDRESS2, c.CITY, c.PROVINCE, c.COUNTRY, c.POSTALCODE
8. FROM orders o, contact c
9. WHERE c.contactID = contactID
------------------------------------------
Pls help me to overcome this issue.
Thanks in Advance
|