p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Oracle (http://p2p.wrox.com/forumdisplay.php?f=105)
-   -   Error while compiling PL/SQL function in 10g (http://p2p.wrox.com/showthread.php?t=61259)

aagarwal123 August 18th, 2007 01:20 AM

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


All times are GMT -4. The time now is 01:33 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.