Hi,
I dig many google suggestion to find a working solution but I got nothing.
What is the right way to insert a file on a Oracle LOB column with PDO?
I'm always getting a data length of 0 for the content of the LOB in the database. I saw many forum suggesting to use RETURNING in the query with EMPTY_LOB(), even then my LOB is always empty. This is what I have right now (my code is customizable, I gave you just the minimum). I push on arrayOfBind in the same time that I build my variable. Every parameter is in the correct order. I can see my result in my database viewer but LOB always empty.
$sql = "INSERT INTO {$tableName} ({$strCol}) VALUES ({$strBind}) RETURNING {$fileAttr} INTO ?";
$stmt = $connection->prepare($sql); foreach($arrayOfBind as $binding){ $stmt->bindParam($binding[0], $binding[1], $binding[2]); } $stmt->execute(); $stmt->commit();
I try too to insert an EMPTY_LOB() first and after than execute and UPDATE for the LOB, nothing different on the result. If I do stream_get_contents on my file, I saw the data. fileSize give me the correct lenght of the file. My other database columns are filled correctly. (size, mime, name)
Help will be appreciate.
Thanks