Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PDO bindParam and TO_DATE conversion

624894Aug 15 2008 — edited Aug 22 2008
I am using Oracle XE, and I am trying to insert data into a table having a blob column, I am however having problems with the date column.
The date to be inserted has to be converted to a format oracle understands, how do I do this with bindParam. Here is what I am doing (in PHP) :

$entryDate = 'August 05, 2008';
$imageInfo = getimagesize($passportFile);
$date_created = null;
$type = null;
$passportBinary = null;

$stmt = $PDO->prepare("INSERT INTO blobtest (date_created, type, binary) VALUES(:date_created, :type, EMPTY_BLOB()) RETURNING binary INTO :binary");

$stmt->bindParam(':type', $type);
$stmt->bindParam(':date_created', $date_created);
$stmt->bindParam(':binary', $passportBinary, PDO::PARAM_LOB);

$date_created = "TO DATE('$entryDate', 'MONTH DD, YYY')";
$type = $imageInfo['mime'];
$passportBinary = fopen($passportFile, 'rb');

$stmt->execute();

Is there a better way around it ??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2008
Added on Aug 15 2008
4 comments
4,114 views