geofox

Ref cursor

May 7th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.45 KB | None | 0 0
  1. FUNCTION datos(){
  2. $codigo= 1;
  3. $salida = ARRAY();
  4. $c = oci_connect('own_pascua', '123', 'localhost/orcl');
  5.  
  6. $s = oci_parse($c, "call lista_materiasn(:codigo,:ref_cursor)");
  7. $refcur = oci_new_cursor($c);
  8. oci_bind_by_name($s, ':codigo', $codigo);
  9. oci_bind_by_name($s, ':ref_cursor', $refcur, -1, OCI_B_CURSOR);
  10. oci_execute($s);
  11. oci_execute($refcur);
  12.  
  13. WHILE($filas = oci_fetch_array($refcur, OCI_ASSOC)) {
  14.       $salida[] = $filas;
  15.  
  16. }
  17. RETURN $salida;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment