Re: [PHP-DB] PHP 4.3.8/Oracle 9i OCI call question for BLOBs

2004-10-03 Thread Christopher Jones

[EMAIL PROTECTED] wrote:
I'm trying to write text to a BLOB.  I got a valid return code but it did not write the BLOB.  
> I was able to use similar code writing to a CLOB.  Any examples I've seen for BLOBs 
are reading
> from Binary files.  Here's how I did the CLOB, but it would not work for BLOB.  Is 
this a bug in PHP?
$query = "insert into " . getSchema() . "attf_description " .
"(id, narticid, nordertoprint, vheadertoprint, cldescription ) " . 
 " values(" .
   $id . ", " . $articid . ", " . $ordertoprint . ",'"  . $headertoprint . "', EMPTY_CLOB()) "
   . "returning CLDESCRIPTION into :CLDESCRIPTION";

 $parsed = ociparse($connection,$query);
 $clob = OCINewDescriptor($connection, OCI_D_LOB);
 $bind = OCIBindByName($parsed, $clob_name, $clob, -1, OCI_B_CLOB);
 ociexecute($parsed, OCI_DEFAULT);
  $err = $clob->save($clob_data);
  $committed = ocicommit($connection, OCI_DEFAULT);
   OCIFreeStatement( $parsed );
Thanks,
Kathy

BLOB and CLOB handling is similar.  Without knowing your failing code
I cannot tell what your problem is
There is a working BLOB example at:
  
http://forums.oracle.com/forums/thread.jsp?forum=178&thread=233174&message=664200&q=626c6f62#664200
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] PHP 4.3.8/Oracle 9i OCI call question for BLOBs

2004-09-22 Thread kkoehler
One thing I left off.  I changed the Oracle field to a BLOB, replaced OCI_B_CLOB with 
OCI_B_BLOB, the insert was successful but no data was saved to the BLOB.
Kathy

[EMAIL PROTECTED] wrote:
> I'm trying to write text to a BLOB.  I got a valid return code but it did not 
write the BLOB.  I was able to use similar code writing to a CLOB.  Any examples 
I've seen for BLOBs are reading from Binary files.  Here's how I did the CLOB, 
but it would not work for BLOB.  Is this a bug in PHP?
> 
> $query = "insert into " . getSchema() . "attf_description " .
> "(id, narticid, nordertoprint, vheadertoprint, cldescription ) " . 
>  " values(" .
>$id . ", " . $articid . ", " . $ordertoprint . ",'"  . $headertoprint . "', 
EMPTY_CLOB()) "
>. "returning CLDESCRIPTION into :CLDESCRIPTION";
> 
>  $parsed = ociparse($connection,$query);
>  $clob = OCINewDescriptor($connection, OCI_D_LOB);
>  $bind = OCIBindByName($parsed, $clob_name, $clob, -1, OCI_B_CLOB);
>  ociexecute($parsed, OCI_DEFAULT);
>   $err = $clob->save($clob_data);
>   $committed = ocicommit($connection, OCI_DEFAULT);
>OCIFreeStatement( $parsed );
> 
> Thanks,
> Kathy

[PHP-DB] PHP 4.3.8/Oracle 9i OCI call question for BLOBs

2004-09-22 Thread kkoehler
I'm trying to write text to a BLOB.  I got a valid return code but it did not write 
the BLOB.  I was able to use similar code writing to a CLOB.  Any examples I've seen 
for BLOBs are reading from Binary files.  Here's how I did the CLOB, but it would not 
work for BLOB.  Is this a bug in PHP?

$query = "insert into " . getSchema() . "attf_description " .
"(id, narticid, nordertoprint, vheadertoprint, cldescription ) " . 
 " values(" .
   $id . ", " . $articid . ", " . $ordertoprint . ",'"  . $headertoprint . "', 
EMPTY_CLOB()) "
   . "returning CLDESCRIPTION into :CLDESCRIPTION";

 $parsed = ociparse($connection,$query);
 $clob = OCINewDescriptor($connection, OCI_D_LOB);
 $bind = OCIBindByName($parsed, $clob_name, $clob, -1, OCI_B_CLOB);
 ociexecute($parsed, OCI_DEFAULT);
  $err = $clob->save($clob_data);
  $committed = ocicommit($connection, OCI_DEFAULT);
   OCIFreeStatement( $parsed );

Thanks,
Kathy