It depends what Oracle's default date format is. Eg it could be YYYYMMDD,
but you are trying to insert a string with date and time.  Work out what
Oracle date format your character string is in, then either use something
like:

$dbh->do("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'");

to alter the default format for your session, or change the actual insert to
something like:

$dbh->prepare("INSERT INTO MY_TABLE(MY_DATE)
VALUES(TO_DATE(?,'YYYYMMDDHH24MISS'))");

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 6:59 PM
To: [EMAIL PROTECTED]
Subject: how to bind datetime type parameter ?


Hello,

It's very helpful for me if you could spend some time on reading it.

I have a problem about how to insert a column value which type is "DATETIME"
? I tried to use $sth->bind_param(1, $value1, SQL_CHAR);
But it doesn't work. And I got an error message like below :
DBD::Oracle::st execute failed: ORA-01861: 字元不符合格式字串 (DBD ERROR:
OCIStmtExecute) at trans_cc_t_chattel_dtl.pl line 107.

It's content includes Chinese. I tried to translate into English is
"Character doesn't fit the string format ".
I hope to get some suggestions from you, please.

Larry Wu

Australia Post is committed to providing our customers with excellent service.  If we 
can assist you in any way please either telephone 13 13 18 or visit our website 
www.auspost.com.au.

CAUTION

This e-mail and any files transmitted with it are privileged and confidential 
information intended for the use of the addressee. The confidentiality and/or 
privilege in this e-mail is not waived, lost or destroyed if it has been transmitted 
to you in error. If you have received this e-mail in error you must (a) not 
disseminate, copy or take any action in reliance on it; (b) please notify Australia 
Post immediately by return e-mail to the sender; and (c) please delete the original 
e-mail.

Reply via email to