View Single Post
  #1 (permalink)  
Old August 18th, 2007, 01:20 AM
aagarwal123 aagarwal123 is offline
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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