Advertisement
CPV

conexion con oracle OCI y PHP

CPV
Jun 3rd, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php
  2. // ejemplo de conexion con oracle OCI
  3. $conn = oci_connect('userdb', 'passwordb', '192.168.1.33/sidoracle03') or die('ERROR de conexion');
  4.  
  5. $stmt = oci_parse($conn, "select DESCRIPCION,ID,NOMBRE,ARCHIVO,TIPO_ARCHIVO,UBICACION from fou_archvos");
  6. oci_execute($stmt, OCI_DEFAULT);
  7. while (oci_fetch($stmt)) {
  8.     $blob = oci_result($stmt, "ARCHIVO");
  9.     $tipo_archivo = oci_result($stmt, "TIPO_ARCHIVO");
  10.     $id = oci_result($stmt, "ID") . " \t ";
  11.     $descripcion = oci_result($stmt, "DESCRIPCION") . "\n";
  12.     $filename = "/home/kbs/oracle_dropbox/files/" . $tipo_archivo;
  13.     if ($blob and $blob != NULL and is_object($blob) == true and $tipo_archivo != NULL and empty($tipo_archivo) == FALSE) {
  14.  
  15.         if ($blob->export($filename)) {
  16.             $dbResult = file_get_contents($filename);
  17.         }
  18.     }
  19. }
  20. oci_free_cursor($stmt);
  21. oci_close($conn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement