Here are some things you could try.

Remove all the "@" suppressions and make sure error_reporting = E_ALL
and display_errors = On are set in your php.ini.

Echo the SQL statement inside SQLInsertLob() to make sure it is
constructed OK.

Echo the filename to check it includes the appropriate path.  If there
is no path, try using the absolute path e.g. /tmp/myfile.xml

Check $this->ConnectionID is ok and you can do a simple query in
SQLInsertLob().

Change &$lob to $lob (this fixes a different problem).

Chris

EL Marouri Mounir wrote:
hi all,
i have a problem in saving a blob file into oracle database the system is linux 7.3 oracle 9i apache and php things are working pretty
well in other machine (same php source code) but in my machine it gives this
error


savefile():OCILobWrite : OCI_INVALID_HANDLE.

this is the php:

$oci->SQLInsertLob(3, "insert into FICHIER_BDS(FICH_BDS_ID, FICH_BDS_NOM,
BDS_ID, FICH_BDS_SOURCE, FICH_BDS_XML, FICH_BDS_SIZE, FICH_BDS_TYPE, VER_ID)
values (FICH_BDS_ID.nextval, '" .$file_name. "', $BDS_ID,'0',EMPTY_BLOB(),
$file_size, '" .$file_type. "', '" .$VER_ID. "') returning FICH_BDS_XML into
:the_blob",$file);
                                        }
the oci function :
 function SQLInsertLob($num, $req, $lob_upload)
   {
      if ($num < 0 || $num > $this->NumReq)
      {
         $this->err = "Numéro de statement incorrect";
         return false;
      }

     $lob = @OCINewDescriptor($this->ConnectionID, OCI_D_LOB);

     $this->Result[$num] = @OCIParse($this->ConnectionID, $req);

         @OCIBindByName($this->Result[$num], ':the_blob', &$lob, -1, 
OCI_B_BLOB);

         @OCIExecute($this->Result[$num], OCI_DEFAULT);

         if($lob->savefile($lob_upload))
         {
                return true;
                }else{
                return false;
         }

        $lob->free();

        @OCIFreeStatement($this->Result[$num]);

        }

le file is temporary located in /tmp/
apache is runing with apache user when the file is created the permissions
is rw--r--r--i have tried with file 777 to make sure but i still have the
same error and then i have tried to execute the sql statement in sqlplus with '0' as
blob the sql is OK in other page it can load blob file from oracle database


i really don't see where is the problem if someone have any idea

thanks to all









__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/



-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to