Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // ejemplo de conexion con oracle OCI
- $conn = oci_connect('userdb', 'passwordb', '192.168.1.33/sidoracle03') or die('ERROR de conexion');
- $stmt = oci_parse($conn, "select DESCRIPCION,ID,NOMBRE,ARCHIVO,TIPO_ARCHIVO,UBICACION from fou_archvos");
- oci_execute($stmt, OCI_DEFAULT);
- while (oci_fetch($stmt)) {
- $blob = oci_result($stmt, "ARCHIVO");
- $tipo_archivo = oci_result($stmt, "TIPO_ARCHIVO");
- $id = oci_result($stmt, "ID") . " \t ";
- $descripcion = oci_result($stmt, "DESCRIPCION") . "\n";
- $filename = "/home/kbs/oracle_dropbox/files/" . $tipo_archivo;
- if ($blob and $blob != NULL and is_object($blob) == true and $tipo_archivo != NULL and empty($tipo_archivo) == FALSE) {
- if ($blob->export($filename)) {
- $dbResult = file_get_contents($filename);
- }
- }
- }
- oci_free_cursor($stmt);
- oci_close($conn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement