Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Filling field with date when using descriptors
Hi!
In order to upload a BLOB into our DB I use descriptors. Unfortunately, I
have to use the TO_DATE-function to insert a date but I don't know where to
put the statement!
We are using ORACLE 8.1 and PHP.
This is what I tried:
$req = "INSERT INTO REPORT_SERVERFILE (FILE_ID, REALNAME, FILECOMMENT,
UPLOAD_DATE, MIME_TYPE, UPLOAD_FILE) VALUES
(:file_id,:realname,:filecomment, TO_DATE(':upload_date', 'YYYY-MM-DD',
'NLS_DATE_LANGUAGE=American'),:mime_type, EMPTY_BLOB()) returning
upload_file into :upload_file";
And then:
$stmt = OCIParse($conn, $req);
OCIBindByName($stmt, ":upload_date", $current_date, -1);
$current_date is a PHP-variable which represents a date in the format
YYYY-MM-DD.
It doesn't work with the TO_DATE-function instead of $current_date, neither.
Is there any help out there?
Frank Received on Tue Nov 06 2001 - 11:15:16 CST
![]() |
![]() |