home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle.server      Oracle Sysadmins question their careers      44,300 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,638 of 44,300   
   franmerar229@gmail.com to All   
   Re: Returning a REF cursor   
   02 Aug 16 11:54:14   
   
   Something like this:   
      
   CREATE OR REPLACE PACKAGE test_package AS   
      
   TYPE ref_crs IS REF CURSOR;   
      
   PROCEDURE test_procedure (   
     p_score     NUMBER,   
     p_email     VARCHAR2,   
     p_address   VARCHAR2   
     p_data  OUT REF_CRS);   
      
   END test_package;   
   /   
      
   Package created.   
      
   CREATE OR REPLACE PACKAGE BODY test_package AS   
      
   PROCEDURE test_procedure (   
     p_score     NUMBER,   
     p_email     VARCHAR2,   
     p_address   VARCHAR2   
     p_data  OUT REF_CRS) AS   
      
   BEGIN   
     OPEN p_data FOR   
       SELECT email FROM emails WHERE score = p_score;   
   END test_procedure;   
      
   END test_package;   
   /   
      
      
   Then to call it:   
      
   var data refcursor;   
      
   exec test_package.test_procedure (   
     p_score => 5,   
     p_data  => :data);   
      
   BEGIN test_package.test_procedure (; END;   
                                      *   
   ERROR at line 1:   
   ORA-06550: line 1, column 36:   
   PLS-00103: Encountered the symbol ";" when expecting one of the following:   
   ( ) - + case mod new not null    
      
      
   Any thoughts on this one?   
      
   Thanks!!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca