I am using this wrapper as the Oracle PDO in PHP is experimental: https://github.com/yajra/pdo-via-oci8
Here is the PHP code to insert a BLOB that works in MySQL but not yet in Oracle:
public function insertPacket($nist) {
$blob = fopen($nist->getActualFile(), 'rb');
$sql = "INSERT INTO packets(packet) VALUES(:packet)";
$query = $this->link->prepare($sql);
$query->bindParam(':packet', $blob, PDO::PARAM_LOB);
if(!$query->execute()) {
trigger_error(print_r($query->errorInfo(), true), E_USER_ERROR);
}
return $this->link->lastInsertId();
}
In oracle I get this exception: Fatal error: Uncaught exception 'Oci8Exception' with message ' in C:\wamp\www\project\includes\PdoViaOci8\Statement.php on line 156
Oci8Exception: Error Code : 22275
Error Message : ORA-22275: invalid LOB locator specified
Position : 12
Statement : INSERT INTO packets(packet) VALUES(:packet)
Any ideas what I am doing wrong?