title: Retrieve result from cursor of oracle storedprocedure in Perl Script
body: <p>I am finding difficulty in fetching the records from stored procedure(oracle) by invoking it through perl script. SP takes 1 input and ouput parameter is cursor</p>
  <p>--------Here is the perl script_-------------</p>
  <pre><code>my $dbh = DBI-&gt;connect(&quot;dbi:Oracle://**********&quot;,'**',***)  or die &quot;Couldn't connect to database: &quot; . DBI-&gt;errstr;// successfully connected
   
  my $cursorRecords;   
  my $categoryBind = 'tkuat';
  
  my $sth= $dbh-&gt;prepare(q{
   BEGIN
         GetJobEnvironments(:category,:cursorTest);
  END;
  });
  
  $sth-&gt;bind_param(&quot;:category&quot;, $categoryBind);  
  $sth-&gt;bind_param_inout(&quot;:cursorTest&quot;, \$cursorRecords,20000,{ ora_type =&gt; ORA_RSET});    
  $sth-&gt;execute or  die &quot;Can't execute SQL statement\n&quot;;  
  my @row=$cursorRecords-&gt;fetchrow_array();   
  print(&quot;row:@row\n&quot;);  
  print(&quot;cursorRecords:$cursorRecords\n&quot;);  
  print Dumper($sth);
  
  script is executing but not printing the records from the database
  ---O/p:--------
  
  row:  
  cursorRecords:DBI::st=HASH(0x1564318)  
  $VAR1 = bless( {}, 'DBI::st' );
  ------------------------------
  
  SP in Database looks as below    
  create or replace PROCEDURE GetJobEnvironments
  (
    v_category IN CHAR DEFAULT NULL,   
     v_cursor OUT SYS_REFCURSOR   
  )
  AS   
  
  BEGIN    
  
     IF ( v_category IS NULL ) THEN     
         BEGIN   
            OPEN  v_cursor FOR   
            SELECT EnvVar ,  
            VALUE   
            FROM JobEnvironments  ;   
        END;    
     ELSE   
        BEGIN   
           OPEN  v_cursor FOR   
           SELECT EnvVar ,
           VALUE 
           FROM JobEnvironments    
           WHERE  Category = v_category ;   
        END;  
    END IF;   
  
  EXCEPTION
    WHEN OTHERS THEN raise_application_error(-20002,SQLCODE||':'||SQLERRM);    
  END;
  </code></pre>
  <p>Table <code>JobEnvironments</code> also has a records</p>
  <p>Can the reference in <code>bind() $cursorRecords</code> can hold records from a table?
  Can someone please help with this?</p>
  <p>----record from the table------</p>
  <pre><code>select * from  JobEnvironments
  Category,EnvVar,Value,last_update
  -----------------------------------
  tkuat','REUTFEED_SUBJ','RSF.REC',;\'2010-04-07 06:00:33.0'
  </code></pre>