How to Save Date in Yii with Oracle -


how 1 save date in yii oracle?

$trx->date_trx=date('y-m-d'); cdbcommand failed execute sql statement:      sqlstate[hy000]: general error: 1861     ocistmtexecute: ora-01861: literal not match format string         (ext\pdo_oci\oci_statement.c:148).     sql statement executed was:          insert "trx" ("idmember", "date_trx") values (:yp0, :yp1) returning "id" :return_id 

i guess you're supplying character literal date, in format such 'yyyy-mm-dd'. if should explicitly convert date part of insert statement ...

insert "trx" ("idmember", "date_trx") values (:yp0, to_date(:yp1,'yyyy-mm-dd')) returning "id" :return_id 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -